Reuse window variable and only close from root afterEach

This commit is contained in:
Kevin Sawicki 2016-11-29 11:52:31 -08:00
parent d7e7c2b17f
commit fee7683b86

View file

@ -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"'