From 16524fc2e7881d74cf548046b4abe510aa091015 Mon Sep 17 00:00:00 2001 From: Pshenkin Andrey Date: Thu, 29 Jun 2017 10:21:55 +0300 Subject: [PATCH 1/2] add fix --- lib/helper/Nightmare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper/Nightmare.js b/lib/helper/Nightmare.js index 73669bb17..9476b277f 100644 --- a/lib/helper/Nightmare.js +++ b/lib/helper/Nightmare.js @@ -192,7 +192,7 @@ class Nightmare extends Helper { return this._stopBrowser(); } if (this.options.keepCookies) return; - return Promise.all([this.browser.cookies.clearAll(), this.executeScript('localStorage.clear();')]); + return Promise.all([this.browser.cookies.clearAll(), this.executeScript(function () {return localStorage.clear();})]); } _afterSuite() { From 60ca62791c7b0bca13dda40f29ea116d965a7374 Mon Sep 17 00:00:00 2001 From: Pshenkin Andrey Date: Thu, 29 Jun 2017 10:22:10 +0300 Subject: [PATCH 2/2] fix formatting --- lib/helper/Nightmare.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/helper/Nightmare.js b/lib/helper/Nightmare.js index 9476b277f..56f7f0f70 100644 --- a/lib/helper/Nightmare.js +++ b/lib/helper/Nightmare.js @@ -192,7 +192,9 @@ class Nightmare extends Helper { return this._stopBrowser(); } if (this.options.keepCookies) return; - return Promise.all([this.browser.cookies.clearAll(), this.executeScript(function () {return localStorage.clear();})]); + return Promise.all([this.browser.cookies.clearAll(), this.executeScript(function () { + return localStorage.clear(); + })]); } _afterSuite() {