2023-03-20 03:45:40 +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-03-01 10:40:01 +03:00
|
|
|
import react from '@vitejs/plugin-react';
|
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: {
|
|
|
|
'next/router': 'next-router-mock',
|
2023-04-18 08:07:03 +03:00
|
|
|
'next/config': resolve(rootDir, './scripts/vitest/next-config-mock.ts'),
|
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: [
|
|
|
|
resolve(rootDir, './scripts/setup/search.ts'),
|
|
|
|
resolve(rootDir, './scripts/setup/lottie-web.ts'),
|
|
|
|
],
|
2023-03-01 10:40:01 +03:00
|
|
|
include: [
|
|
|
|
'packages/**/*.spec.ts',
|
2023-03-24 01:15:40 +03:00
|
|
|
'packages/**/*.spec.tsx',
|
2023-03-01 23:46:20 +03:00
|
|
|
'apps/web/**/*.spec.ts',
|
|
|
|
'apps/web/**/*.spec.tsx',
|
2023-03-24 01:15:40 +03:00
|
|
|
'tests/unit/**/*.spec.ts',
|
|
|
|
'tests/unit/**/*.spec.tsx',
|
2023-03-01 10:40:01 +03:00
|
|
|
],
|
2023-02-17 05:43:52 +03:00
|
|
|
testTimeout: 5000,
|
|
|
|
coverage: {
|
|
|
|
provider: 'istanbul', // or 'c8'
|
|
|
|
reporter: ['lcov'],
|
|
|
|
reportsDirectory: '.coverage/store',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|