diff options
Diffstat (limited to 'config/electronJestSetup.cjs')
-rw-r--r-- | config/electronJestSetup.cjs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/electronJestSetup.cjs b/config/electronJestSetup.cjs new file mode 100644 index 0000000..c53a3f8 --- /dev/null +++ b/config/electronJestSetup.cjs | |||
@@ -0,0 +1,13 @@ | |||
1 | const electron = /** @type {{ ELECTRON_MODULE: import('electron')}} */ ( | ||
2 | /** @type {unknown} */ (globalThis) | ||
3 | ).ELECTRON_MODULE; | ||
4 | |||
5 | const { BrowserWindow } = electron; | ||
6 | |||
7 | jest.mock('electron', () => electron); | ||
8 | |||
9 | afterEach(() => { | ||
10 | BrowserWindow.getAllWindows().forEach((window) => { | ||
11 | window.destroy(); | ||
12 | }); | ||
13 | }); | ||