2023-07-28 06:06:50 +03:00
|
|
|
import { resolve } from 'node:path';
|
2023-04-18 08:07:03 +03:00
|
|
|
import { fileURLToPath } from 'node:url';
|
2023-03-01 10:40:01 +03:00
|
|
|
|
2023-04-04 20:46:33 +03:00
|
|
|
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';
|
|
|
|
|
2023-04-18 08:07:03 +03:00
|
|
|
const rootDir = fileURLToPath(new URL('.', import.meta.url));
|
|
|
|
|
2023-02-17 05:43:52 +03:00
|
|
|
export default defineConfig({
|
2023-04-04 20:46:33 +03:00
|
|
|
plugins: [react(), vanillaExtractPlugin()],
|
2023-03-11 02:45:10 +03:00
|
|
|
assetsInclude: ['**/*.md'],
|
2023-03-01 10:40:01 +03:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2023-07-10 11:03:18 +03:00
|
|
|
// prevent tests using two different sources of yjs
|
2023-07-28 06:06:50 +03:00
|
|
|
yjs: resolve(rootDir, 'node_modules/yjs'),
|
2023-03-01 10:40:01 +03:00
|
|
|
},
|
|
|
|
},
|
2023-02-17 05:43:52 +03:00
|
|
|
test: {
|
2023-04-18 08:07:03 +03:00
|
|
|
setupFiles: [
|
2023-04-24 21:18:37 +03:00
|
|
|
resolve(rootDir, './scripts/setup/lit.ts'),
|
2023-04-18 08:07:03 +03:00
|
|
|
resolve(rootDir, './scripts/setup/lottie-web.ts'),
|
2023-06-28 14:19:19 +03:00
|
|
|
resolve(rootDir, './scripts/setup/global.ts'),
|
2023-04-18 08:07:03 +03:00
|
|
|
],
|
2023-07-28 06:06:50 +03:00
|
|
|
include: [
|
2023-10-18 18:30:08 +03:00
|
|
|
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
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|