Closed reitbauer closed 1 year ago
When Wallaby runs vitest
it runs with the configuration set for your project. From what you said above, you're providing additional vitest
overrides/otpions when you use the CLI.
Instead of running vitest
CLI with the environment option, can you please update your configuration to set the environment? It should work for you.
vite.config.ts
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
environment: 'jsdom',
// other options...
},
})
Issue description or question
In my project I use the window.localStorage. If I try to test this class I always get the error "ReferenceError: window is not defined" if I run the tests with the command "vitest --environment jsdom" all tests pass.
I have written a simple test for demo:
Wallaby diagnostics report