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

✅ Move tests to Vitest #4871

Merged
merged 4 commits into from
Apr 7, 2024
Merged

✅ Move tests to Vitest #4871

merged 4 commits into from
Apr 7, 2024

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Apr 7, 2024

My target is to be able to make fast-check ES Modules first.

I initially attempted to stick to Jest, but I failed. More precisely having Jest in ES Modules mode required: experimental flags, usage of unstable APIs, using arrow imports instead of normal ones, migrating out of spies and relying on requireActual while I'd need to importActual (aka missing API).

Unfortunately I was not able to reach an acceptable state. he main blocker being the arrow import that would impose to add some linting rule to make sure that all my tests do only arrow imports. The next blocker was rewriting all the spies to move them to mock and spies.

So I got directed to Vitest. I tried and spies were ok, import too.

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

Sorry, something went wrong.

dubzzz added 2 commits April 7, 2024 12:52
Copy link

codesandbox-ci bot commented Apr 7, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7a58359:

Sandbox Source
@fast-check/examples Configuration

Copy link
Contributor

github-actions bot commented Apr 7, 2024

👋 A preview of the new documentation is available at: http://6612984cbdfc6fb490ba0273--dubzzz-fast-check.netlify.app

Copy link

codecov bot commented Apr 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.57%. Comparing base (08079e1) to head (7a58359).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4871      +/-   ##
==========================================
+ Coverage   93.49%   93.57%   +0.07%     
==========================================
  Files         207      209       +2     
  Lines        5015     5093      +78     
  Branches     1314     1360      +46     
==========================================
+ Hits         4689     4766      +77     
+ Misses        326      300      -26     
- Partials        0       27      +27     
Flag Coverage Δ
unit-tests 93.57% <ø> (+0.07%) ⬆️
unit-tests-18.x-Linux 93.57% <ø> (+0.07%) ⬆️
unit-tests-20.x-Linux 93.57% <ø> (+0.07%) ⬆️
unit-tests-latest-Linux 93.57% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@dubzzz dubzzz enabled auto-merge (squash) April 7, 2024 13:07
@dubzzz dubzzz disabled auto-merge April 7, 2024 13:08
Copy link
Contributor

github-actions bot commented Apr 7, 2024

👋 A preview of the new documentation is available at: http://66129b5c00c5bfbc9c091bdc--dubzzz-fast-check.netlify.app

@dubzzz
Copy link
Owner Author

dubzzz commented Apr 7, 2024

From my first measurements, with the same coverage reporter in place for both Jest and Vitest, Vitest is 33% slower. But I hope to make it faster with some cleaning and no globals mode.

@dubzzz dubzzz enabled auto-merge (squash) April 7, 2024 13:13

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

github-actions bot commented Apr 7, 2024

👋 A preview of the new documentation is available at: http://66129e091f1acab74c039ae1--dubzzz-fast-check.netlify.app

@dubzzz dubzzz merged commit ac73a1e into main Apr 7, 2024
52 checks passed
@dubzzz dubzzz deleted the test-vitest branch April 7, 2024 13:28
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.

None yet

1 participant