diff --git a/package.json b/package.json index 4ddd78c1..26a27631 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "sign": "node debug/sign.js", "start": "node ./scripts/launchdev.js", "test:e2e": "npx playwright test", - "test:unit": "vitest run --config vite.main.config.ts", + "test:unit": "vitest run", "test:update-snapshots": "npx playwright test --update-snapshots", "todesktop:afterPack": "./scripts/todesktop/afterPack.cjs", "todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.cjs", diff --git a/vite.main.config.ts b/vite.main.config.ts index 1292bfb7..7dec701b 100644 --- a/vite.main.config.ts +++ b/vite.main.config.ts @@ -44,6 +44,7 @@ export default defineConfig((env) => { mainFields: ['module', 'jsnext:main', 'jsnext'], }, test: { + name: 'main', include: ['tests/unit/**/*'], }, }; diff --git a/vite.preload.config.ts b/vite.preload.config.ts index 2fbb774b..497e7506 100644 --- a/vite.preload.config.ts +++ b/vite.preload.config.ts @@ -20,6 +20,11 @@ export default defineConfig((env) => { }, }, }, + test: { + name: 'preload', + include: ['tests/preload/**/*'], + environment: 'jsdom', + }, }; return mergeConfig(getBuildConfig(env), config); diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 00000000..2105c50a --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,10 @@ +import { defineWorkspace } from 'vitest/config'; + +export default defineWorkspace([ + { + extends: './vite.main.config.ts', + }, + { + extends: './vite.preload.config.ts', + }, +]);