mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-05-08 22:07:32 +08:00
37 lines
1001 B
TypeScript
37 lines
1001 B
TypeScript
// TODO(@forehalo): reuse '@affine-tools/utils' once it's ready to switch to esm module
|
|
import { resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const rootDir = fileURLToPath(new URL('../../../..', import.meta.url));
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
// prevent tests using two different sources of yjs
|
|
yjs: resolve(rootDir, 'node_modules/yjs'),
|
|
'@affine/electron': resolve(
|
|
rootDir,
|
|
'packages/frontend/apps/electron/src'
|
|
),
|
|
},
|
|
},
|
|
|
|
test: {
|
|
setupFiles: [resolve(rootDir, './scripts/setup/global.ts')],
|
|
include: ['./test/**/*.spec.ts'],
|
|
testTimeout: 60000,
|
|
hookTimeout: 30000,
|
|
pool: 'forks',
|
|
maxWorkers: 1,
|
|
coverage: {
|
|
provider: 'istanbul', // or 'istanbul'
|
|
reporter: ['lcov'],
|
|
reportsDirectory: resolve(rootDir, '.coverage/electron'),
|
|
},
|
|
},
|
|
});
|