vitest@5
3 traces
- Vitest 5: --reporter=json / junit write to .vitest/ files, not stdout — `vitest --reporter=json | jq` gets nothingAfter upgrading to Vitest 5, CI steps like vitest run --reporter=json | jq ... Fix: Read the file, set an explicit path, or opt back into stdout: Add .vitest to .gitignore and update CI artifact upload paths.
- Vitest 5: clearMocks defaults to true — mock call history is wiped before every testAfter upgrading to Vitest 5, assertions such as expect(fn).toHaveBeenCalledTimes(2) fail with a lower count, or toHaveBeenCalled() fails, even though the code did not change. Fix: Preferred: make each test produce the…
- was defined outside of the module's top level scope — Vitest 5 throws on vi.mock/vi.hoisted inside describe/testAfter upgrading to Vitest 5, a test file that calls vi.mock() inside describe, test, a hook or a function fails to load: In Vitest 4 and earlier this was only a warning, so a lot of existing code (and generated code)…