Are setupFiles
and globals
config options linked?
#1485
Answered
by
sheremet-va
mrmartineau
asked this question in
Q&A
-
To clarify, I just setup Vitest with this (simplified) config: export default defineConfig({
test: {
environment: 'happy-dom',
globals: true,
setupFiles: ['./vitest.setup.ts'],
},
}); With this config, the test runs fine without any issues, but when I removed the
FYI my import { installGlobals } from '@remix-run/node/globals';
import '@testing-library/jest-dom';
installGlobals(); This leads me to conclude that the |
Beta Was this translation helpful? Give feedback.
Answered by
sheremet-va
Jun 14, 2022
Replies: 1 comment 3 replies
-
No, setupFiles is always running. Its just you are using library that expects “expect” to be defined globally |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
mrmartineau
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, setupFiles is always running. Its just you are using library that expects “expect” to be defined globally