2022-04-15 15:19:05 +00:00
|
|
|
import { resolve } from 'node:path'
|
2022-02-16 18:07:33 +00:00
|
|
|
import { defineConfig } from 'vite'
|
2023-01-20 16:23:16 +00:00
|
|
|
import { configDefaults } from 'vitest/config'
|
2022-04-12 18:36:39 +00:00
|
|
|
import { isWindows } from 'std-env'
|
2022-02-16 18:07:33 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
2022-07-21 10:44:33 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2023-03-17 15:24:39 +00:00
|
|
|
'#app': resolve('./packages/nuxt/dist/app/index'),
|
2023-04-06 12:07:22 +00:00
|
|
|
'@nuxt/test-utils/experimental': resolve('./packages/test-utils/src/experimental.ts'),
|
2023-03-22 21:37:07 +00:00
|
|
|
'@nuxt/test-utils': resolve('./packages/test-utils/src/index.ts')
|
2022-07-21 10:44:33 +00:00
|
|
|
}
|
2022-03-17 22:17:59 +00:00
|
|
|
},
|
2022-04-07 19:15:30 +00:00
|
|
|
test: {
|
2023-01-22 16:46:45 +00:00
|
|
|
globalSetup: 'test/setup.ts',
|
2023-01-20 16:23:16 +00:00
|
|
|
testTimeout: isWindows ? 60000 : 10000,
|
|
|
|
// 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'],
|
2023-02-13 22:09:32 +00:00
|
|
|
maxThreads: process.env.TEST_ENV === 'dev' ? 1 : undefined,
|
|
|
|
minThreads: process.env.TEST_ENV === 'dev' ? 1 : undefined
|
2022-02-16 18:07:33 +00:00
|
|
|
}
|
|
|
|
})
|