From c77e07bc1539e3d395047a03adbfb1ef0e2e249d Mon Sep 17 00:00:00 2001 From: Ryohei Ikegami Date: Wed, 12 Apr 2017 11:55:41 +0900 Subject: [PATCH] Fix afterEach --- spec/modules-spec.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/modules-spec.js b/spec/modules-spec.js index 02fec41..7cc5d34 100644 --- a/spec/modules-spec.js +++ b/spec/modules-spec.js @@ -4,6 +4,7 @@ const path = require('path') const temp = require('temp') const {remote} = require('electron') const {BrowserWindow} = remote +const {closeWindow} = require('./window-helpers') describe('third-party module', function () { var fixtures = path.join(__dirname, 'fixtures') @@ -142,14 +143,15 @@ describe('require', () => { }) }) + afterEach(async () => { + await closeWindow(w) + w = null + }) + it('searches for module under app directory', async () => { w.loadURL('about:blank') const result = await w.webContents.executeJavaScript('typeof require("q").when') assert.equal(result, 'function') }) - - afterEach(() => { - w.destroy() - }) }) }) -- 2.7.4