lecheminvert.tech/vitest.config.ts
Adam Belkacemi cf6ee64e31
Some checks are pending
CI / tests (push) Waiting to run
CI / deploiement (push) Blocked by required conditions
Import initial : code en production sur Hetzner
2026-09-07 18:21:38 +00:00

39 lines
1 KiB
TypeScript

import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import { defineVitestProject } from '@nuxt/test-utils/config'
export default defineConfig({
test: {
projects: [
{
// Les tests unitaires tournent hors Nuxt : on redeclare l'alias #shared.
resolve: {
alias: { '#shared': fileURLToPath(new URL('./shared', import.meta.url)) },
},
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',
include: ['server/**', 'shared/**'],
},
},
})