Use window close helper instead of destroying for coverage
authorKevin Sawicki <kevinsawicki@gmail.com>
Thu, 3 Nov 2016 23:43:16 +0000 (16:43 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 7 Nov 2016 16:25:01 +0000 (08:25 -0800)
spec/webview-spec.js

index 2c0b809..4fb9694 100644 (file)
@@ -3,6 +3,7 @@ const path = require('path')
 const http = require('http')
 const url = require('url')
 const {app, session, getGuestWebContents, ipcMain, BrowserWindow} = require('electron').remote
+const {closeWindow} = require('./window-helpers')
 
 describe('<webview> tag', function () {
   this.timeout(20000)
@@ -21,10 +22,7 @@ describe('<webview> tag', function () {
       document.body.appendChild(webview)
     }
     webview.remove()
-    if (w) {
-      w.destroy()
-      w = null
-    }
+    return closeWindow(w).then(function () { w = null })
   })
 
   it('works without script tag in page', function (done) {