chore: split vitest (#3426)

This commit is contained in:
Alex Yang
2023-07-27 20:06:50 -07:00
committed by GitHub
parent 8185ee991b
commit 0ab1cfdeb6
6 changed files with 49 additions and 24 deletions
+1
View File
@@ -54,6 +54,7 @@
"ts-node": "^10.9.1",
"undici": "^5.22.1",
"uuid": "^9.0.0",
"vitest": "^0.33.0",
"which": "^3.0.1",
"zx": "^7.2.3"
},
+31
View File
@@ -0,0 +1,31 @@
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('../..', import.meta.url));
const pluginOutputDir = resolve(rootDir, './apps/electron/dist/plugins');
export default defineConfig({
resolve: {
alias: {
// prevent tests using two different sources of yjs
yjs: resolve(rootDir, 'node_modules/yjs'),
},
},
define: {
'process.env.PLUGIN_DIR': JSON.stringify(pluginOutputDir),
},
test: {
include: ['./src/**/*.spec.ts'],
exclude: ['**/node_modules', '**/dist', '**/build', '**/out'],
testTimeout: 5000,
singleThread: true,
threads: false,
coverage: {
provider: 'istanbul', // or 'c8'
reporter: ['lcov'],
reportsDirectory: resolve(rootDir, '.coverage/electron'),
},
},
});