test: move some BrowserWindow specs to the main runner (#18551)

This commit is contained in:
Jeremy Apthorp 2019-06-03 15:10:58 -07:00 committed by GitHub
parent cf628d9287
commit 901cdb22e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 564 additions and 442 deletions

View file

@ -30,9 +30,12 @@ export const closeWindow = async (
if (assertNotWindows) {
const windows = BrowserWindow.getAllWindows()
for (const win of windows) {
await ensureWindowIsClosed(win)
try {
expect(windows).to.have.lengthOf(0)
} finally {
for (const win of windows) {
await ensureWindowIsClosed(win)
}
}
expect(windows).to.have.lengthOf(0)
}
}