From 7108c642f4ff6dc5f0c4d30b8a8960064ff8e90f Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 31 Dec 2021 01:52:28 +0100 Subject: 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. --- scripts/build.js | 2 +- scripts/update-electron-vendors.js | 2 +- scripts/watch.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') 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'; import { join } from 'path'; import { build as viteBuild } from 'vite'; -import { fileURLToDirname } from '../config/build-common.js'; +import { fileURLToDirname } from '../config/utils.js'; const thisDir = fileURLToDirname(import.meta.url); 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'; import { writeFile } from 'fs/promises'; import { join, resolve } from 'path'; -import { fileURLToDirname } from '../config/build-common.js'; +import { fileURLToDirname } from '../config/utils.js'; /** * 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'; import { join } from 'path'; import { createServer } from 'vite'; -import { fileURLToDirname } from '../config/build-common.js'; +import { fileURLToDirname } from '../config/utils.js'; /** @type {string} */ const thisDir = fileURLToDirname(import.meta.url); @@ -127,7 +127,7 @@ function setupMainPackageWatcher(viteDevServer) { const path = '/'; process.env.VITE_DEV_SERVER_URL = `${protocol}//${host}:${port}${path}`; - /** @type {import('child_process').ChildProcessWithoutNullStreams | null} */ + /** @type {import('child_process').ChildProcessByStdio | null} */ let spawnProcess = null; return setupEsbuildWatcher( -- cgit v1.2.3-54-g00ecf