build: 添加nuxt测试框架

This commit is contained in:
2025-10-25 14:05:47 +08:00
parent 088eee07bf
commit a2c6006e37
4 changed files with 403 additions and 16 deletions

23
vitest.config.ts Normal file
View File

@ -0,0 +1,23 @@
import { defineConfig } from 'vitest/config';
import { defineVitestProject } from '@nuxt/test-utils/config';
export default defineConfig({
test: {
projects: [
{
test: {
name: 'unit',
include: ['test/{e2e,unit}/*.{test,spec}.ts'],
environment: 'node',
},
},
await defineVitestProject({
test: {
name: 'nuxt',
include: ['test/nuxt/*.{test.spec}.ts'],
environment: 'nuxt',
},
}),
],
},
});