aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-31 01:52:28 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-31 01:56:30 +0100
commit7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f (patch)
treef8c0450a6e1b62f7e7f8470efd375b3659b91b2b /scripts
parentrefactor: Install devtools extensions earlier (diff)
downloadsophie-7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f.tar.gz
sophie-7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f.tar.zst
sophie-7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f.zip
test: Add tests for main package
- Changed jest to run from the root package and reference the packages as projects. This required moving the base jest config file away from the project root. - Module isolation seems to prevent ts-jest from loading the shared package, so we disabled it for now. - To better facilitate mocking, services should be split into interfaces and implementation - Had to downgrade to chald 4.1.2 as per https://github.com/chalk/chalk/releases/tag/v5.0.0 at least until https://github.com/microsoft/TypeScript/issues/46452 is resolved.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build.js2
-rw-r--r--scripts/update-electron-vendors.js2
-rw-r--r--scripts/watch.js4
3 files changed, 4 insertions, 4 deletions
diff --git a/scripts/build.js b/scripts/build.js
index 9b9b26e..ef2b998 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -2,7 +2,7 @@ import { build as esbuildBuild } from 'esbuild';
2import { join } from 'path'; 2import { join } from 'path';
3import { build as viteBuild } from 'vite'; 3import { build as viteBuild } from 'vite';
4 4
5import { fileURLToDirname } from '../config/build-common.js'; 5import { fileURLToDirname } from '../config/utils.js';
6 6
7const thisDir = fileURLToDirname(import.meta.url); 7const thisDir = fileURLToDirname(import.meta.url);
8 8
diff --git a/scripts/update-electron-vendors.js b/scripts/update-electron-vendors.js
index fea8b9d..b2f4ca4 100644
--- a/scripts/update-electron-vendors.js
+++ b/scripts/update-electron-vendors.js
@@ -3,7 +3,7 @@ import electronPath from 'electron';
3import { writeFile } from 'fs/promises'; 3import { writeFile } from 'fs/promises';
4import { join, resolve } from 'path'; 4import { join, resolve } from 'path';
5 5
6import { fileURLToDirname } from '../config/build-common.js'; 6import { fileURLToDirname } from '../config/utils.js';
7 7
8/** 8/**
9 * Returns versions of electron vendors 9 * Returns versions of electron vendors
diff --git a/scripts/watch.js b/scripts/watch.js
index 82a8feb..b635fac 100644
--- a/scripts/watch.js
+++ b/scripts/watch.js
@@ -5,7 +5,7 @@ import electronPath from 'electron';
5import { join } from 'path'; 5import { join } from 'path';
6import { createServer } from 'vite'; 6import { createServer } from 'vite';
7 7
8import { fileURLToDirname } from '../config/build-common.js'; 8import { fileURLToDirname } from '../config/utils.js';
9 9
10/** @type {string} */ 10/** @type {string} */
11const thisDir = fileURLToDirname(import.meta.url); 11const thisDir = fileURLToDirname(import.meta.url);
@@ -127,7 +127,7 @@ function setupMainPackageWatcher(viteDevServer) {
127 const path = '/'; 127 const path = '/';
128 process.env.VITE_DEV_SERVER_URL = `${protocol}//${host}:${port}${path}`; 128 process.env.VITE_DEV_SERVER_URL = `${protocol}//${host}:${port}${path}`;
129 129
130 /** @type {import('child_process').ChildProcessWithoutNullStreams | null} */ 130 /** @type {import('child_process').ChildProcessByStdio<null, null, import('stream').Readable> | null} */
131 let spawnProcess = null; 131 let spawnProcess = null;
132 132
133 return setupEsbuildWatcher( 133 return setupEsbuildWatcher(