Files
compiler-explorer/test
Matt Godbolt 9b76c60701 Update vitest to 4.0.1 and fix test mocking for constructor support (#8213)
## Summary
- Updates vitest and @vitest/coverage-v8 from 2.1.8 to 4.0.1
- Fixes test mocks to work with vitest 4.0's constructor support
requirements

## Changes
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.

### Key refactorings:
- **Class-based mocks in vi.mock()**: Defined mock classes directly in
`vi.mock()` factories instead of using `.mockImplementation()` with
arrow functions
- **Shared mock implementations**: Created shared `vi.fn()` instances
that can be configured per-test, avoiding the need for
`.mockImplementation()`
- **Biome linter compatibility**: The approach avoids
`.mockImplementation()` entirely, preventing biome from converting
`function` keywords back to arrow functions

### Files changed:
- `package.json`, `package-lock.json`: vitest version updates
- `test/app/config-tests.ts`: Refactored CompilerProps mocks with shared
cePropsImpl
- `test/app/main-tests.ts`: Refactored all constructor mocks
(CompilerFinder, FormattingService, CompileHandler, etc.)

## Test plan
- [x] All tests pass with `npm run test-min`
- [x] Linter passes with `npm run lint`  
- [x] Type checking passes with `npm run ts-check`
- [x] Pre-commit hooks pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-04 08:55:58 -06:00
..
2025-10-02 14:05:56 -05:00
2021-10-05 01:45:05 +02:00
2019-08-21 01:26:16 +02:00
2025-01-29 10:41:03 -06:00
2021-09-13 20:22:27 +02:00
2024-10-27 15:28:38 +02:00
2024-10-26 17:42:22 +02:00
2024-03-08 22:25:09 -06:00
2025-07-28 10:34:46 -05:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2023-07-10 21:31:04 -05:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2025-07-28 10:34:46 -05:00
2024-03-08 22:25:09 -06:00
2025-07-28 10:34:46 -05:00