From 68c49c0eb22595db9473d23a0230b8b6e8a943e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Wed, 13 Jun 2018 13:01:27 +0200 Subject: [PATCH] fixed #151 --- CHANGELOG.md | 3 ++- lib/modules/browser_requests.js | 3 +-- tests/browser_components/request_mocker.test.js | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c17a9489..0ec8eb0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ -0.7.6 / ####-##-## +0.7.6 / 2018-06-13 ================== + * Fixed request interceptor unhandled error 0.7.5 / 2018-06-12 ================== diff --git a/lib/modules/browser_requests.js b/lib/modules/browser_requests.js index 93d24af2..9f6a2ab3 100644 --- a/lib/modules/browser_requests.js +++ b/lib/modules/browser_requests.js @@ -47,7 +47,6 @@ module.exports = class BrowserRequests extends BrowserModule { _beforeClose() { this.clearMocks(); this.clearRequests(); - return this._startRequestInterceptor(); } _startRequestInterceptor() { @@ -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(); } }); diff --git a/tests/browser_components/request_mocker.test.js b/tests/browser_components/request_mocker.test.js index 3e16fc52..ea50ecae 100644 --- a/tests/browser_components/request_mocker.test.js +++ b/tests/browser_components/request_mocker.test.js @@ -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); + }); });