AFFiNE/packages/frontend/electron/vitest.config.ts

28 lines
726 B
TypeScript
Raw Normal View History

2023-07-28 06:06:50 +03:00
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('../../..', import.meta.url));
2023-07-28 06:06:50 +03:00
export default defineConfig({
resolve: {
alias: {
// prevent tests using two different sources of yjs
yjs: resolve(rootDir, 'node_modules/yjs'),
'@affine/electron': resolve(rootDir, 'packages/frontend/electron/src'),
2023-07-28 06:06:50 +03:00
},
},
test: {
include: ['./test/**/*.spec.ts'],
2023-07-28 06:06:50 +03:00
testTimeout: 5000,
singleThread: true,
threads: false,
coverage: {
provider: 'istanbul', // or 'c8'
reporter: ['lcov'],
reportsDirectory: resolve(rootDir, '.coverage/electron'),
},
},
});