Nuxt/vitest.config.ts

24 lines
880 B
TypeScript
Raw Normal View History

import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import { configDefaults } from 'vitest/config'
import { isWindows } from 'std-env'
export default defineConfig({
resolve: {
alias: {
2023-03-17 15:24:39 +00:00
'#app': resolve('./packages/nuxt/dist/app/index'),
'@nuxt/test-utils/experimental': resolve('./packages/test-utils/src/experimental.ts'),
'@nuxt/test-utils': resolve('./packages/test-utils/src/index.ts')
}
},
test: {
2023-01-22 16:46:45 +00:00
globalSetup: 'test/setup.ts',
testTimeout: isWindows ? 60000 : 10000,
deps: { inline: ['@vitejs/plugin-vue'] },
// Excluded plugin because it should throw an error when accidentally loaded via Nuxt
2023-01-22 16:46:45 +00:00
exclude: [...configDefaults.exclude, '**/this-should-not-load.spec.js'],
maxThreads: process.env.TEST_ENV === 'dev' ? 1 : undefined,
minThreads: process.env.TEST_ENV === 'dev' ? 1 : undefined
}
})