Skip to content

Commit

Permalink
fixed #151
Browse files Browse the repository at this point in the history
  • Loading branch information
angrykoala committed Jun 13, 2018
1 parent 1f7c6e2 commit 68c49c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.7.6 / ####-##-##
0.7.6 / 2018-06-13
==================

* Fixed request interceptor unhandled error

0.7.5 / 2018-06-12
==================
Expand Down
3 changes: 1 addition & 2 deletions lib/modules/browser_requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ module.exports = class BrowserRequests extends BrowserModule {
_beforeClose() {
this.clearMocks();
this.clearRequests();
return this._startRequestInterceptor();
}

_startRequestInterceptor() {
Expand All @@ -58,7 +57,7 @@ module.exports = class BrowserRequests extends BrowserModule {
const mockedResponse = this._requestMocker.getMockedResponse(request);
if(mockedResponse) {
return request.respond(mockedResponse);
} else{
} else {
return request.continue();
}
});
Expand Down
5 changes: 5 additions & 0 deletions tests/browser_components/request_mocker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,9 @@ describe("Requests Mocker", function() {
await browser.wait(100);
await browser.assert.text("#result", "MOCK");
});

it("Interceptor Is Ready After Close", async () => {
await browser.close();
assert.strictEqual(browser.requests._interceptorReady, true);
});
});

0 comments on commit 68c49c0

Please sign in to comment.