Skip to content

Conversation

@leeyi45
Copy link
Contributor

@leeyi45 leeyi45 commented Aug 24, 2025

Migrate to Vitest

Following the modules repo and frontend, this PR migrates the repository to Vitest. I've tried to minimize changes where possible since Vitest was designed as a drop in for Jest, but unlike Jest Vitest requires calls to toMatchInlineSnapshot to be directly from expect.

Relocation of Enums

The Chapter, Variant, ErrorType and ErrorSeverity enums needed to be relocated to other files to allow Vitest to actually work. I suspect it has something to do with the circular imports that aren't just elided during runtime.

I'm not sure if they should be re-exported through the types.ts file though.

Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot! There are very minor TODOs but they can be done in a future PR since I don't want to have to look through 300 files and 20k lines of changes again…

Can't wait to go into TS v5

Comment on lines +80 to +81
// TODO: The snapshots just never match for whatever reason
describe.skip('Test output options', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you figure this out?

@@ -1,5 +1,7 @@
// TODO: Convert to actual benchmark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get around to this?

@@ -1,4 +1,6 @@
#!/usr/bin/env node
/* istanbul ignore file */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we using v8 instead of istanbul for coverage?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't figure out why snapshots are not generated for this file (and also svmc.test.ts when I unskip locally). But it's minor and can always fix later.

@RichDom2185 RichDom2185 enabled auto-merge (squash) November 4, 2025 18:58
@RichDom2185 RichDom2185 disabled auto-merge November 4, 2025 19:00
@RichDom2185 RichDom2185 mentioned this pull request Nov 4, 2025
7 tasks
@RichDom2185 RichDom2185 changed the title Migrate to Vitest Migrate to Vitest, TypeScript 5.9, NodeJS 22 Nov 4, 2025
@RichDom2185 RichDom2185 enabled auto-merge (squash) November 4, 2025 19:08
@RichDom2185 RichDom2185 merged commit 68dfa29 into master Nov 4, 2025
4 checks passed
@RichDom2185 RichDom2185 deleted the vitest-testing-refactor branch November 4, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants