Fix afterEach

This commit is contained in:
Ryohei Ikegami 2017-04-12 11:55:41 +09:00
parent 24fedb2e20
commit c77e07bc15

View file

@ -4,6 +4,7 @@ const path = require('path')
const temp = require('temp') const temp = require('temp')
const {remote} = require('electron') const {remote} = require('electron')
const {BrowserWindow} = remote const {BrowserWindow} = remote
const {closeWindow} = require('./window-helpers')
describe('third-party module', function () { describe('third-party module', function () {
var fixtures = path.join(__dirname, 'fixtures') 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 () => { it('searches for module under app directory', async () => {
w.loadURL('about:blank') w.loadURL('about:blank')
const result = await w.webContents.executeJavaScript('typeof require("q").when') const result = await w.webContents.executeJavaScript('typeof require("q").when')
assert.equal(result, 'function') assert.equal(result, 'function')
}) })
afterEach(() => {
w.destroy()
})
}) })
}) })