-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't load vitest.config.ts
automatically.
#872
Comments
Hey there, @jinyongp! 👋 I'm here to help you out with any bugs, questions, or becoming a contributor. Let's squash those bugs together! To ensure that the // vitest.config.ts
import { defineVitestConfig } from '@nuxt/test-utils/config'
export default defineVitestConfig({
test: {
globals: true,
silent: true,
environment: 'nuxt',
include: [
'server/**/*.test.ts',
],
exclude: [
'**/-*.*',
],
}
}) Additionally, ensure that your // nuxt.config.ts
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'@nuxt/test-utils/module'
],
testUtils: {
startOnBoot: true,
logToConsole: true,
vitestConfig: {
// No need to specify the config path here
}
}
}) If the If you continue to experience issues, it might be related to a known issue where the // nuxt.config.ts
import { defineNuxtConfig } from 'nuxt'
import vitestConfig from './vitest.config.ts'
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'@nuxt/test-utils/module'
],
testUtils: {
startOnBoot: true,
logToConsole: true,
vitestConfig: vitestConfig
}
}) This should ensure that the |
duplicate #837 the issue has not been solved yet, so I will keep it open. |
Environment
Reproduction
Reproduction on CodeSandbox
Describe the bug
After adding
@nuxt/test-utils/module
tonuxt.config.ts
, thevitest.config.ts
file in the root directory is not automatically loaded. Even when explicitly specifyingvitestConfig.config
in thetestUtils
property, thevitest.config.ts
is not being applied.Here is the configuration:
I have observed a difference in the results when running tests directly with vitest and running them via nuxt dev.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: