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-05-04 08:35:09 +03:00
|
|
|
resolve(rootDir, './scripts/setup/i18n.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: [
|
|
|
|
resolve(rootDir, 'packages/**/*.spec.ts'),
|
|
|
|
resolve(rootDir, 'packages/**/*.spec.tsx'),
|
2023-08-03 04:48:35 +03:00
|
|
|
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
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|