Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Vitest #3563

Merged
merged 6 commits into from
Jun 14, 2024
Merged

Switch to Vitest #3563

merged 6 commits into from
Jun 14, 2024

Conversation

colinhacks
Copy link
Owner

@colinhacks colinhacks commented Jun 10, 2024

Easy switch, Vitest is great.

Benchmarking

With Jest + ts-jest — 4000ms

carbon - 2024-06-13T220229 398

With Vitest — 1.3s

carbon - 2024-06-13T222014 089

Issues

vitest.workspace.ts...another workspace file

My only complaint is the need for a vitest.workspace.ts. It would be nice if this read from "workspaces" in package.json. I couldn't find a satisfactory discussion on this subject on the Vitest repo but maybe I missed something.

I have the same complaint with pnpm. Why do these tools all need their own workspace files? If the performance penalty from parsing a bunch of package.jsons is a factor, maybe these tools could converge on a convention like workspace.yml.

typecheck.exclude doesn't seem to work as expected

I couldn't get typechecking to include my test files and exclude the files in zod/deno/lib. The globs definitely aren't resolving in a normal way. I ended up just setting ignoreSourceErrors: true which isn't a good long term solution. There's been some confusion about Vite's approach to glob expansion in the past: vitest-dev/vitest#4767

If anyone wants to repro this, disable ignoreSourceErrors in vitest.root.ts and run pnpm test. Feel free to play around with some different include/exclude globs.

@colinhacks colinhacks changed the base branch from main to v4 June 10, 2024 22:20
@colinhacks colinhacks merged commit 7754782 into v4 Jun 14, 2024
4 checks passed
@colinhacks colinhacks deleted the v4-vitest branch June 14, 2024 05:06
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.

1 participant