From fee7683b868bbaf4a628343e4890b5937d34c0a3 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 29 Nov 2016 11:52:31 -0800 Subject: [PATCH] Reuse window variable and only close from root afterEach --- spec/api-session-spec.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spec/api-session-spec.js b/spec/api-session-spec.js index f6e69808b5..b9b6dd0a51 100644 --- a/spec/api-session-spec.js +++ b/spec/api-session-spec.js @@ -236,9 +236,8 @@ describe('session module', function () { }) describe('will-download event', function () { - var w = null - beforeEach(function () { + if (w != null) w.destroy() w = new BrowserWindow({ show: false, width: 400, @@ -246,10 +245,6 @@ describe('session module', function () { }) }) - afterEach(function () { - return closeWindow(w).then(function () { w = null }) - }) - it('can cancel default download behavior', function (done) { const mockFile = new Buffer(1024) const contentDisposition = 'inline; filename="mockFile.txt"'