test: fixup assertNotWindows (#41045)
* chore: fixup assertNotWindows * remove logging
This commit is contained in:
parent
7e6fb97a2f
commit
3dafb318a8
1 changed files with 13 additions and 7 deletions
|
@ -29,7 +29,11 @@ export const closeWindow = async (
|
||||||
await ensureWindowIsClosed(window);
|
await ensureWindowIsClosed(window);
|
||||||
|
|
||||||
if (assertNotWindows) {
|
if (assertNotWindows) {
|
||||||
const windows = BaseWindow.getAllWindows();
|
let windows = BaseWindow.getAllWindows();
|
||||||
|
if (windows.length > 0) {
|
||||||
|
setTimeout(async () => {
|
||||||
|
// Wait until next tick to assert that all windows have been closed.
|
||||||
|
windows = BaseWindow.getAllWindows();
|
||||||
try {
|
try {
|
||||||
expect(windows).to.have.lengthOf(0);
|
expect(windows).to.have.lengthOf(0);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -37,6 +41,8 @@ export const closeWindow = async (
|
||||||
await ensureWindowIsClosed(win);
|
await ensureWindowIsClosed(win);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue