mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 13:31:37 +03:00
cc5a6e6d40
packages/frontend/web -> packages/frontend/apps/web packages/frontend/mobile -> packages/frontend/apps/mobile packages/frontend/electron -> packages/frontend/apps/electron
38 lines
924 B
TypeScript
38 lines
924 B
TypeScript
import { resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import react from '@vitejs/plugin-react-swc';
|
|
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: 5000,
|
|
poolOptions: {
|
|
forks: {
|
|
singleFork: true,
|
|
},
|
|
},
|
|
coverage: {
|
|
provider: 'istanbul', // or 'c8'
|
|
reporter: ['lcov'],
|
|
reportsDirectory: resolve(rootDir, '.coverage/electron'),
|
|
},
|
|
},
|
|
});
|