AFFiNE/vitest.config.ts

43 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/i18n.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/**/*.spec.ts'),
resolve(rootDir, 'packages/**/*.spec.tsx'),
resolve(rootDir, 'apps/core/**/*.spec.ts'),
resolve(rootDir, 'apps/core/**/*.spec.tsx'),
2023-07-28 06:06:50 +03:00
resolve(rootDir, 'tests/unit/**/*.spec.ts'),
resolve(rootDir, 'tests/unit/**/*.spec.tsx'),
],
2023-04-25 02:53:36 +03:00
exclude: ['**/node_modules', '**/dist', '**/build', '**/out'],
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
},
},
});