aboutsummaryrefslogtreecommitdiffstats
path: root/config/electronJestSetup.cjs
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-03 19:47:39 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-16 00:55:02 +0200
commitd2aa484b600dc0d122bb994b9bb29504ffe4cf12 (patch)
tree1d3e38fdb22f7afe02f1ebcf4b07734761970985 /config/electronJestSetup.cjs
parentrefactor: config file saving and debugging (diff)
downloadsophie-d2aa484b600dc0d122bb994b9bb29504ffe4cf12.tar.gz
sophie-d2aa484b600dc0d122bb994b9bb29504ffe4cf12.tar.zst
sophie-d2aa484b600dc0d122bb994b9bb29504ffe4cf12.zip
build: integration testing support
Run integration tests in an electron environment for the main process. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'config/electronJestSetup.cjs')
-rw-r--r--config/electronJestSetup.cjs13
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 @@
1const electron = /** @type {{ ELECTRON_MODULE: import('electron')}} */ (
2 /** @type {unknown} */ (globalThis)
3).ELECTRON_MODULE;
4
5const { BrowserWindow } = electron;
6
7jest.mock('electron', () => electron);
8
9afterEach(() => {
10 BrowserWindow.getAllWindows().forEach((window) => {
11 window.destroy();
12 });
13});