test: update vitest coverage exclusions

This commit is contained in:
Daniel Roe 2023-12-21 11:09:15 +00:00
parent 1a9fb57532
commit a46b0c876c
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { resolve } from 'node:path'
import { configDefaults, defineConfig } from 'vitest/config'
import { configDefaults, coverageConfigDefaults, defineConfig } from 'vitest/config'
import { isWindows } from 'std-env'
import codspeedPlugin from '@codspeed/vitest-plugin'
@ -16,6 +16,9 @@ export default defineConfig({
test: {
globalSetup: './test/setup.ts',
setupFiles: ['./test/setup-env.ts'],
coverage: {
exclude: [...coverageConfigDefaults.exclude, 'packages/nuxt/src/app', 'playground', '**/test/', 'scripts', 'vitest.nuxt.config.ts']
},
testTimeout: isWindows ? 60000 : 10000,
// Excluded plugin because it should throw an error when accidentally loaded via Nuxt
exclude: [...configDefaults.exclude, 'nuxt/**', '**/test.ts', '**/this-should-not-load.spec.js'],

View File

@ -3,6 +3,9 @@ import { defineVitestConfig } from '@nuxt/test-utils/config'
export default defineVitestConfig({
test: {
dir: './test/nuxt',
coverage: {
include: ['packages/nuxt/src/app']
},
environment: 'nuxt',
environmentOptions: {
nuxt: {