Skip to content

✨(vitest) Get rid of deprecated vitest/suite imports#6766

Merged
dubzzz merged 3 commits into
dubzzz:mainfrom
nielk:vitest-8-warnings
Apr 2, 2026
Merged

✨(vitest) Get rid of deprecated vitest/suite imports#6766
dubzzz merged 3 commits into
dubzzz:mainfrom
nielk:vitest-8-warnings

Conversation

@nielk

@nielk nielk commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Description

Importing from vitest/suite is now deprecated since Vitest 4.1.

When executing vitest tests with fast-check/vitest we get theses warnings:

Importing from "vitest/suite" is deprecated since Vitest 4.1. Please use static methods of "TestRunner" from the "vitest" entry point instead: e.g., `TestRunner.getCurrentTest()`.

This pull-request use static methods of "TestRunner" from the "vitest" entry point instead of "vitest/suite". (deprecated since Vitest 4.1)

Fixes #6746

Checklist

Don't delete this checklist and make sure you do the following before opening the PR

  • I have a full understanding of every line in this PR — whether the code was hand-written, AI-generated, copied from external sources or produced by any other tool
  • I flagged the impact of my change (minor / patch / major) either by running pnpm run bump or by following the instructions from the changeset bot
  • I kept this PR focused on a single concern and did not bundle unrelated changes
  • I followed the gitmoji specification for the name of the PR, including the package scope (e.g. 🐛(vitest) Something...) when the change targets a package other than fast-check
  • I added relevant tests and they would have failed without my PR (when applicable)

@nielk
nielk requested a review from dubzzz as a code owner March 24, 2026 16:22
@changeset-bot

changeset-bot Bot commented Mar 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 90ed207

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

This PR includes changesets to release 1 package
Name Type
@fast-check/vitest Minor

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

@pkg-pr-new

pkg-pr-new Bot commented Mar 24, 2026

Copy link
Copy Markdown
@fast-check/ava

npm i https://pkg.pr.new/@fast-check/ava@6766

fast-check

npm i https://pkg.pr.new/fast-check@6766

@fast-check/jest

npm i https://pkg.pr.new/@fast-check/jest@6766

@fast-check/packaged

npm i https://pkg.pr.new/@fast-check/packaged@6766

@fast-check/poisoning

npm i https://pkg.pr.new/@fast-check/poisoning@6766

@fast-check/vitest

npm i https://pkg.pr.new/@fast-check/vitest@6766

@fast-check/worker

npm i https://pkg.pr.new/@fast-check/worker@6766

commit: 90ed207

@nielk
nielk force-pushed the vitest-8-warnings branch from 6fb1d88 to 8c94ff3 Compare March 24, 2026 16:27
@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.52%. Comparing base (a169c08) to head (90ed207).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6766   +/-   ##
=======================================
  Coverage   94.52%   94.52%           
=======================================
  Files         210      210           
  Lines        5685     5685           
  Branches     1498     1498           
=======================================
  Hits         5374     5374           
  Misses        298      298           
  Partials       13       13           
Flag Coverage Δ
tests 94.52% <ø> (ø)

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.

@nielk nielk changed the title 🗑️(vitest) Get rid of deprecated vitest/suite syntaxes 🗑️(vitest) Get rid of deprecated vitest/suite imports Mar 25, 2026
Comment thread .changeset/brave-hands-see.md Outdated
@@ -0,0 +1,5 @@
---
'@fast-check/vitest': patch

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Probably a major? I feel that the peerDep range for vitest might not be valid anymore. Put minor if confirmed (we want to stay at 0.x atm)

Comment thread .changeset/brave-hands-see.md Outdated
@dubzzz

dubzzz commented Mar 27, 2026

Copy link
Copy Markdown
Owner

@nielk Thanks a lot for the contribution. I just updated your PR with a few changes to change our peer requirements. I may wait a few weeks before releasing the version to wait for our users to be on vitest 4.1 but I'll release it soon anyway

@dubzzz dubzzz changed the title 🗑️(vitest) Get rid of deprecated vitest/suite imports ✨(vitest) Get rid of deprecated vitest/suite imports Mar 27, 2026
@dubzzz
dubzzz merged commit ed0902d into dubzzz:main Apr 2, 2026
52 checks passed
@dubzzz

dubzzz commented Apr 2, 2026

Copy link
Copy Markdown
Owner

@claude propose a new PR to adapt the readme of fast-check/vitest to explain our requirements for 0.4.0 based on newly introduced changes

@claude

claude Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Claude finished @dubzzz's task in 1m 14s —— View jobclaude/pr-6766-20260402-2224Create PR ➔


Updating README for @fast-check/vitest 0.4.0 requirements

Added a new row for 0.4 in the minimal requirements table documenting the vitest ^4.1.0 peer dependency, and added footnote (7) explaining that deprecated vitest/suite imports were replaced by TestRunner static methods from the vitest entry point.

·

dubzzz added a commit that referenced this pull request Apr 2, 2026
## Description

Update the minimal requirements table in the `@fast-check/vitest` README
to document the new vitest ^4.1.0 peer dependency requirement for
version 0.4.0.

Related to #6766

## Checklist

— _Don't delete this checklist and make sure you do the following before
opening the PR_

- [x] I have a full understanding of every line in this PR — whether the
code was hand-written, AI-generated, copied from external sources or
produced by any other tool
- [ ] I flagged the impact of my change (minor / patch / major) either
by running `pnpm run bump` or by following the instructions from the
changeset bot
- [x] I kept this PR focused on a single concern and did not bundle
unrelated changes
- [x] I followed the [gitmoji](https://gitmoji.dev/) specification for
the name of the PR, including the package scope (e.g. `🐛(vitest)
Something...`) when the change targets a package other than `fast-check`
- [ ] I added relevant tests and they would have failed without my PR
(when applicable)

Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Nicolas DUBIEN <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

@fast-check/[email protected] uses deprecated Vitest import

2 participants