AFFiNE/vitest.config.ts

46 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-07-28 06:06:50 +03:00
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
2023-07-20 13:52:29 +03:00
import react from '@vitejs/plugin-react-swc';
2023-02-17 05:43:52 +03:00
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('.', import.meta.url));
2023-02-17 05:43:52 +03:00
export default defineConfig({
plugins: [react(), vanillaExtractPlugin()],
assetsInclude: ['**/*.md'],
resolve: {
alias: {
// prevent tests using two different sources of yjs
2023-07-28 06:06:50 +03:00
yjs: resolve(rootDir, 'node_modules/yjs'),
},
},
2023-02-17 05:43:52 +03:00
test: {
setupFiles: [
resolve(rootDir, './scripts/setup/lit.ts'),
resolve(rootDir, './scripts/setup/lottie-web.ts'),
resolve(rootDir, './scripts/setup/global.ts'),
],
2023-07-28 06:06:50 +03:00
include: [
resolve(rootDir, 'packages/common/**/*.spec.ts'),
resolve(rootDir, 'packages/common/**/*.spec.tsx'),
resolve(rootDir, 'packages/frontend/**/*.spec.ts'),
resolve(rootDir, 'packages/frontend/**/*.spec.tsx'),
],
exclude: [
'**/node_modules',
'**/dist',
'**/build',
'**/out,',
'**/frontend/electron',
2023-07-28 06:06:50 +03:00
],
2023-02-17 05:43:52 +03:00
testTimeout: 5000,
coverage: {
provider: 'istanbul', // or 'c8'
reporter: ['lcov'],
2023-07-28 06:06:50 +03:00
reportsDirectory: resolve(rootDir, '.coverage/store'),
2023-02-17 05:43:52 +03:00
},
},
});