Use beforeEach/afterEach
This commit is contained in:
parent
001d03c859
commit
9cb6bc098d
1 changed files with 10 additions and 2 deletions
|
@ -134,13 +134,21 @@ describe('Module._nodeModulePaths', function () {
|
||||||
|
|
||||||
describe('require', () => {
|
describe('require', () => {
|
||||||
describe('when loaded URL is not file: protocol', () => {
|
describe('when loaded URL is not file: protocol', () => {
|
||||||
it('searches for module under app directory', async () => {
|
let w
|
||||||
const w = new BrowserWindow({
|
|
||||||
|
beforeEach(() => {
|
||||||
|
w = new BrowserWindow({
|
||||||
show: false
|
show: false
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
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()
|
w.destroy()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue