From: Ryohei Ikegami Date: Wed, 12 Apr 2017 02:55:41 +0000 (+0900) Subject: Fix afterEach X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c77e07bc1539e3d395047a03adbfb1ef0e2e249d;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Fix afterEach --- 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() - }) }) })