test: 优化测试代码
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m5s
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m5s
- 显式导入相关依赖以避免相关问题
This commit is contained in:
@ -1,7 +1,36 @@
|
||||
import { defineVitestConfig } from '@nuxt/test-utils/config';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { defineVitestProject } from '@nuxt/test-utils/config';
|
||||
|
||||
export default defineVitestConfig({
|
||||
export default defineConfig({
|
||||
test: {
|
||||
environment: 'nuxt',
|
||||
globals: true,
|
||||
projects: [
|
||||
{
|
||||
test: {
|
||||
name: 'unit',
|
||||
include: [
|
||||
'app/**/*.test.ts',
|
||||
'app/**/*.spec.ts',
|
||||
'server/**/*.test.ts',
|
||||
'server/**/*.spec.ts',
|
||||
],
|
||||
environment: 'node',
|
||||
},
|
||||
},
|
||||
await defineVitestProject({
|
||||
test: {
|
||||
name: 'nuxt',
|
||||
include: ['tests/nuxt/**/*.{test,spec}.ts'],
|
||||
environment: 'nuxt',
|
||||
},
|
||||
}),
|
||||
{
|
||||
test: {
|
||||
name: 'e2e',
|
||||
include: ['test/e2e/*.{test,spec}.ts'],
|
||||
environment: 'node',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user