35 lines
805 B
TypeScript
35 lines
805 B
TypeScript
|
|
import { fileURLToPath } from 'node:url'
|
||
|
|
import { defineConfig } from 'vitest/config'
|
||
|
|
import { defineVitestProject } from '@nuxt/test-utils/config'
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
test: {
|
||
|
|
projects: [
|
||
|
|
{
|
||
|
|
test: {
|
||
|
|
name: 'unit',
|
||
|
|
include: ['test/unit/*.{test,spec}.ts'],
|
||
|
|
environment: 'node',
|
||
|
|
},
|
||
|
|
},
|
||
|
|
await defineVitestProject({
|
||
|
|
test: {
|
||
|
|
name: 'nuxt',
|
||
|
|
include: ['test/nuxt/*.{test,spec}.ts'],
|
||
|
|
environment: 'nuxt',
|
||
|
|
environmentOptions: {
|
||
|
|
nuxt: {
|
||
|
|
rootDir: fileURLToPath(new URL('.', import.meta.url)),
|
||
|
|
domEnvironment: 'happy-dom',
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
],
|
||
|
|
coverage: {
|
||
|
|
enabled: true,
|
||
|
|
provider: 'v8',
|
||
|
|
},
|
||
|
|
},
|
||
|
|
})
|