mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-28 09:14:57 +03:00
7c2574b1ca
Co-authored-by: Himself65 <himself65@outlook.com>
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
|
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const rootDir = fileURLToPath(new URL('.', import.meta.url));
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), vanillaExtractPlugin()],
|
|
assetsInclude: ['**/*.md'],
|
|
resolve: {
|
|
alias: {
|
|
'next/router': 'next-router-mock',
|
|
'next/config': resolve(rootDir, './scripts/vitest/next-config-mock.ts'),
|
|
},
|
|
},
|
|
test: {
|
|
setupFiles: [
|
|
resolve(rootDir, './scripts/setup/lit.ts'),
|
|
resolve(rootDir, './scripts/setup/i18n.ts'),
|
|
resolve(rootDir, './scripts/setup/search.ts'),
|
|
resolve(rootDir, './scripts/setup/lottie-web.ts'),
|
|
],
|
|
include: [
|
|
'packages/**/*.spec.ts',
|
|
'packages/**/*.spec.tsx',
|
|
'apps/web/**/*.spec.ts',
|
|
'apps/web/**/*.spec.tsx',
|
|
'apps/electron/layers/**/*.spec.ts',
|
|
'tests/unit/**/*.spec.ts',
|
|
'tests/unit/**/*.spec.tsx',
|
|
],
|
|
exclude: ['**/node_modules', '**/dist', '**/build', '**/out'],
|
|
testTimeout: 5000,
|
|
coverage: {
|
|
provider: 'istanbul', // or 'c8'
|
|
reporter: ['lcov'],
|
|
reportsDirectory: '.coverage/store',
|
|
},
|
|
},
|
|
});
|