Close windows instead of destroying them

This commit is contained in:
Kevin Sawicki 2016-08-03 12:47:53 -07:00
parent cce6be1900
commit 0ebe142b2f
10 changed files with 45 additions and 62 deletions

View file

@ -5,6 +5,7 @@ const net = require('net')
const fs = require('fs')
const path = require('path')
const {remote} = require('electron')
const {closeWindow} = require('./window-helpers')
const {app, BrowserWindow, ipcMain} = remote
@ -19,9 +20,6 @@ describe('electron module', function () {
let window = null
beforeEach(function () {
if (window != null) {
window.destroy()
}
window = new BrowserWindow({
show: false,
width: 400,
@ -30,10 +28,7 @@ describe('electron module', function () {
})
afterEach(function () {
if (window != null) {
window.destroy()
}
window = null
return closeWindow(window).then(function () { window = null })
})
it('always returns the internal electron module', function (done) {
@ -191,10 +186,7 @@ describe('app module', function () {
})
afterEach(function () {
if (w != null) {
w.destroy()
}
w = null
return closeWindow(w).then(function () { w = null })
})
it('can import certificate into platform cert store', function (done) {
@ -232,10 +224,7 @@ describe('app module', function () {
var w = null
afterEach(function () {
if (w != null) {
w.destroy()
}
w = null
return closeWindow(w).then(function () { w = null })
})
it('should emit browser-window-focus event when window is focused', function (done) {