Skip to content

chore(test): update to vitest 3 #1936

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

Merged
merged 3 commits into from
Apr 13, 2025

Conversation

seriouslag
Copy link
Contributor

@seriouslag seriouslag commented Apr 12, 2025

In this PR, we update Vite, Vitest, and linting dependencies and fix general dependency warnings.

  • Unit tests needed to be changed to remove hanging promises.
  • I removed the call to fetch inside one test, as the fetch was causing a core dump.
  • Added a new root folder to hold shared configs
  • Created a new package to share base vite(st) configs
  • Used shared base vite(st) configs in projects

In the changes, typescript had issues determining the types from the return types of mutations of @tanstack/*-query.
We updated mutations to have a return type explicitly.
This will cause a patch package bump in openapi-ts and update all snapshots involving a mutation using @tanstack/*-query.

We have moved to using base vite(st) configs to configure the runs easier and to change the Windows runs to use threads instead of forks as specified in the vitest common errors.

I am unsure why the code coverage was reduced by so much. Maybe I am missing some coverage files, more code is now counted in the coverage calculations, or the algorithm changed in the update.

Copy link

stackblitz bot commented Apr 12, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Apr 12, 2025

🦋 Changeset detected

Latest commit: ba2e5ca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2025 10:50pm

Copy link

pkg-pr-new bot commented Apr 13, 2025

Open in StackBlitz

@hey-api/client-axios

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-axios@1936

@hey-api/client-fetch

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-fetch@1936

@hey-api/client-nuxt

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-nuxt@1936

@hey-api/client-next

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-next@1936

@hey-api/nuxt

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@1936

@hey-api/openapi-ts

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@1936

@hey-api/vite-plugin

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@1936

commit: ba2e5ca

Copy link

codecov bot commented Apr 13, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 22.34%. Comparing base (b885405) to head (ba2e5ca).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...rc/plugins/@tanstack/query-core/mutationOptions.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1936      +/-   ##
==========================================
- Coverage   29.03%   22.34%   -6.69%     
==========================================
  Files         194      251      +57     
  Lines       26871    21026    -5845     
  Branches      724      781      +57     
==========================================
- Hits         7802     4699    -3103     
+ Misses      19063    16321    -2742     
  Partials        6        6              
Flag Coverage Δ
unittests 22.34% <0.00%> (-6.69%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mrlubos mrlubos merged commit eda1829 into hey-api:main Apr 13, 2025
15 of 17 checks passed
@github-actions github-actions bot mentioned this pull request Apr 13, 2025
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.

2 participants