Skip to content

Commit 5871dea

Browse files
committed
🐛 fix(test): 修复 vitest 配置类型错误
- 从 `vite` 导入 `defineConfig` 以解决类型问题 - 使用 `@ts-expect-error` 忽略 `test` 属性的类型错误
1 parent a9eb164 commit 5871dea

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

vitest.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/// <reference types="vitest" />
2-
import { defineConfig } from 'vitest/config';
2+
import { defineConfig as defineViteConfig } from 'vite';
33
import react from '@vitejs/plugin-react';
44

5-
export default defineConfig({
5+
export default defineViteConfig({
66
plugins: [react()],
7+
// @ts-expect-error - vitest extends Vite config, 'test' property is valid at runtime
78
test: {
89
globals: true,
910
environment: 'jsdom',

0 commit comments

Comments
 (0)