mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: drop unused assertNotWindows param from closeAllWindows
vitest passes a context object as the first arg to hook callbacks, so afterEach(closeAllWindows) effectively called closeAllWindows(ctx) - a truthy value that triggered the unused assert-no-windows-remain path, producing unhandled rejections. afterAll(closeAllWindows) failed outright with a FixtureParseError because vitest parses the param list. No caller ever passed the argument explicitly, so the param is removed.
This commit is contained in:
@@ -48,10 +48,10 @@ export const closeWindow = async (
|
||||
}
|
||||
};
|
||||
|
||||
export async function closeAllWindows(assertNotWindows = false) {
|
||||
export async function closeAllWindows() {
|
||||
let windowsClosed = 0;
|
||||
for (const w of BaseWindow.getAllWindows()) {
|
||||
await closeWindow(w, { assertNotWindows });
|
||||
await closeWindow(w, { assertNotWindows: false });
|
||||
windowsClosed++;
|
||||
}
|
||||
return windowsClosed;
|
||||
|
||||
Reference in New Issue
Block a user