Vitest 4.0 now supports vi.fn() being used as constructors, which means
arrow functions can no longer be used in mock implementations that will be
called as constructors. This change required refactoring test mocks to use
proper class-based approaches.
Key changes:
- Updated vitest and @vitest/coverage-v8 to 4.0.1
- Refactored test mocks to use class definitions in vi.mock factories
- Created shared mock implementations to allow per-test configuration
- Used class-based mocks instead of arrow function .mockImplementation()
- Fixed biome linter conflicts by avoiding .mockImplementation() entirely
The solution uses a pattern where mocks are defined as classes in vi.mock()
with shared vi.fn() instances that can be configured in individual tests,
avoiding the need for .mockImplementation() which biome would convert
back to arrow functions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>