fix(core): vitest on windows (#6100)

This commit is contained in:
Peng Xiao 2024-03-13 04:32:39 +00:00
parent 9e1adfed81
commit e8f83a237d
No known key found for this signature in database
GPG Key ID: 23F23D9E8B3971ED

View File

@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react-swc';
import * as fg from 'fast-glob';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('.', import.meta.url));
@ -26,10 +27,9 @@ export default defineConfig({
resolve(rootDir, './scripts/setup/global.ts'),
],
include: [
resolve(rootDir, 'packages/common/**/*.spec.ts'),
resolve(rootDir, 'packages/common/**/*.spec.tsx'),
resolve(rootDir, 'packages/frontend/**/*.spec.ts'),
resolve(rootDir, 'packages/frontend/**/*.spec.tsx'),
// rootDir cannot be used as a pattern on windows
fg.convertPathToPattern(rootDir) +
'packages/{common,frontend}/**/*.spec.{ts,tsx}',
],
exclude: [
'**/node_modules',