-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: prepare the Vitest API to be stable #6962
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
sheremet-va
merged 73 commits into
vitest-dev:main
from
sheremet-va:refactor/vitest-prepare-stable
Dec 10, 2024
Merged
feat: prepare the Vitest API to be stable #6962
sheremet-va
merged 73 commits into
vitest-dev:main
from
sheremet-va:refactor/vitest-prepare-stable
Dec 10, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
d267bf6 to
2d421a5
Compare
483acc6 to
78d0af9
Compare
AriPerkkio
reviewed
Dec 9, 2024
AriPerkkio
reviewed
Dec 9, 2024
9c5cc3d to
c9e14c2
Compare
AriPerkkio
previously approved these changes
Dec 10, 2024
renovate bot
added a commit
to mmkal/eslint-plugin-mmkal
that referenced
this pull request
Jan 16, 2025
##### [v3.0.0](https://github.com/vitest-dev/vitest/releases/tag/v3.0.0) ##### 🚨 Breaking Changes - `spy.mockReset` changes - by [@Lordfirespeed](https://github.com/Lordfirespeed) in vitest-dev/vitest#6426 [<samp>(db7a8)</samp>](vitest-dev/vitest@db7a8888) - Pass down context to test hooks - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7034 [<samp>(82c2e)</samp>](vitest-dev/vitest@82c2e244) - Support Vite 6 - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7026 [<samp>(7abe8)</samp>](vitest-dev/vitest@7abe854c) - **coverage**: Always exclude test files - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7254 [<samp>(b5268)</samp>](vitest-dev/vitest@b5268965) - **deps**: Update fake-timers to v14.0.0 - by [@xxzefgh](https://github.com/xxzefgh) and [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7097 [<samp>(c98b4)</samp>](vitest-dev/vitest@c98b4b1c) - **expect**: Check more properties for error equality - by [@hi-ogawa](https://github.com/hi-ogawa) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#5876 [<samp>(10023)</samp>](vitest-dev/vitest@100230e9) - **runner**: Support `describe(..., { shuffle: boolean })` and inherit from parent suite - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6670 [<samp>(aa1da)</samp>](vitest-dev/vitest@aa1dac3d) - **snapshot**: Reset snapshot state for `retry` and `repeats` - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6817 [<samp>(e8ce9)</samp>](vitest-dev/vitest@e8ce94cf) - **spy**: SpyOn reuses mock if method is already spyed on - by [@sheremet-va](https://github.com/sheremet-va) and [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6464 [<samp>(b3e43)</samp>](vitest-dev/vitest@b3e43d04) - **vitest**: Don't expose default toFake config - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6288 [<samp>(e3144)</samp>](vitest-dev/vitest@e3144fd8) ##### 🚀 Features - Support inline `diff` options and support `printBasicPrototype` - by [@hi-ogawa](https://github.com/hi-ogawa), [@sheremet-va](https://github.com/sheremet-va) and **Michał Grzegorzewski** in vitest-dev/vitest#6740 [<samp>(39186)</samp>](vitest-dev/vitest@391860f7) - Allow a custom note when calling `ctx.skip()` dynamically - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6805 [<samp>(697c3)</samp>](vitest-dev/vitest@697c35c5) - Allow inline workspace configuration - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6923 [<samp>(562e1)</samp>](vitest-dev/vitest@562e1b14) - Provide the current project to the global setup - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6942 [<samp>(a5bbc)</samp>](vitest-dev/vitest@a5bbc0a9) - Print project name as a label - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6925 [<samp>(a3bef)</samp>](vitest-dev/vitest@a3bef598) - Print a deprecation warning if suite or test uses object as the third argument - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7031 [<samp>(407f1)</samp>](vitest-dev/vitest@407f10e4) - Expose versions from `vitest/node` entry point and statically on Vitest - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7029 [<samp>(be8d4)</samp>](vitest-dev/vitest@be8d479b) - `diff.printBasicPrototype: false` by default - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7043 [<samp>(2b5c5)</samp>](vitest-dev/vitest@2b5c5201) - Prepare the Vitest API to be stable - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6962 [<samp>(9a1b5)</samp>](vitest-dev/vitest@9a1b5012) - Support Vite v6 in mocker package - by [@cexbrayat](https://github.com/cexbrayat) in vitest-dev/vitest#7058 [<samp>(96f47)</samp>](vitest-dev/vitest@96f47d37) - Allow multi-browser configuration - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6975 [<samp>(78b62)</samp>](vitest-dev/vitest@78b62ffe) - Add resolved project names to the reporter API - by [@userquin](https://github.com/userquin) in vitest-dev/vitest#7213 [<samp>(91758)</samp>](vitest-dev/vitest@91758360) - Introduce the new reporter API - by [@sheremet-va](https://github.com/sheremet-va) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7069 [<samp>(76662)</samp>](vitest-dev/vitest@766624ab) - Add `describe.for` - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7253 [<samp>(0ad28)</samp>](vitest-dev/vitest@0ad2860b) - **api**: - Add onBrowserInit event - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7255 [<samp>(80ce0)</samp>](vitest-dev/vitest@80ce0e1c) - **browser**: - Support `actionTimeout` as playwright provider options - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6984 [<samp>(e2c29)</samp>](vitest-dev/vitest@e2c29eaf) - Support clipboard api `userEvent.copy, cut, paste` - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6769 [<samp>(843a6)</samp>](vitest-dev/vitest@843a621e) - Implement locator.nth() - by [@xeger](https://github.com/xeger) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7137 [<samp>(38458)</samp>](vitest-dev/vitest@38458ea6) - **cli**: - Support excluding projects with `--project=!pattern` - by [@haines](https://github.com/haines) in vitest-dev/vitest#6924 [<samp>(ebfe9)</samp>](vitest-dev/vitest@ebfe942c) - Support specifying a line number when filtering tests - by [@mzhubail](https://github.com/mzhubail) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6411 [<samp>(4d94b)</samp>](vitest-dev/vitest@4d94b956) - Support location filters for suites - by [@mzhubail](https://github.com/mzhubail) in vitest-dev/vitest#7048 [<samp>(751e2)</samp>](vitest-dev/vitest@751e2dce) - **coverage**: - `thresholds` to support maximum uncovered items - by [@jonahkagan](https://github.com/jonahkagan) in vitest-dev/vitest#7061 [<samp>(bde98)</samp>](vitest-dev/vitest@bde98b6d) - **expect**: - Add `toHaveBeenCalledExactlyOnceWith` expect matcher - by [@jacoberdman2147](https://github.com/jacoberdman2147) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6894 [<samp>(ff662)</samp>](vitest-dev/vitest@ff66206a) - Add `toHaveBeenCalledAfter` and `toHaveBeenCalledBefore` utility - by [@Barbapapazes](https://github.com/Barbapapazes) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6056 [<samp>(85e6f)</samp>](vitest-dev/vitest@85e6f99f) - Add `toSatisfy` asymmetric matcher - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7022 [<samp>(f691a)</samp>](vitest-dev/vitest@f691ad76) - Add `toBeOneOf` matcher - by [@zirkelc](https://github.com/zirkelc) and [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6974 [<samp>(3d742)</samp>](vitest-dev/vitest@3d742b2b) - **reporter**: - Add support for function type to classname option in the junit reporter - by [@jpleclerc](https://github.com/jpleclerc), **Jean-Philippe Leclerc** and [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6839 [<samp>(dc238)</samp>](vitest-dev/vitest@dc238e92) - **reporters**: - `summary` option for `verbose` and `default` reporters - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6893 [<samp>(511b7)</samp>](vitest-dev/vitest@511b73c7) - **runner**: - Test context can inject values from the config's `provide` - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6813 [<samp>(85c64)</samp>](vitest-dev/vitest@85c64e35) - Add "queued" state - by [@sheremet-va](https://github.com/sheremet-va) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6931 [<samp>(5f8d2)</samp>](vitest-dev/vitest@5f8d2091) - **snapshot**: - Provide `config` to `resolveSnapshotPath` - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6800 [<samp>(746d8)</samp>](vitest-dev/vitest@746d8986) - **ui**: - Allow run individual tests/suites from the UI - by [@userquin](https://github.com/userquin) in vitest-dev/vitest#6641 [<samp>(d9cc8)</samp>](vitest-dev/vitest@d9cc81dd) - Make clicking on a test in the UI open the report section and scroll to the test failure if applicable - by [@jacoberdman2147](https://github.com/jacoberdman2147) in vitest-dev/vitest#6900 [<samp>(1bf27)</samp>](vitest-dev/vitest@1bf27f0d) - Allow hide/show node_modules in module graph tab - by [@userquin](https://github.com/userquin) in vitest-dev/vitest#7217 [<samp>(50cf6)</samp>](vitest-dev/vitest@50cf61b8) - **vitest**: - Include `coverageMap` in json report - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6606 [<samp>(9c8f7)</samp>](vitest-dev/vitest@9c8f7e3e) - Add `onTestsRerun` method to global setup context - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6803 [<samp>(e26e0)</samp>](vitest-dev/vitest@e26e066c) ##### 🐞 Bug Fixes - Misc fix for vite 6 ecosystem ci - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6867 [<samp>(80f8b)</samp>](vitest-dev/vitest@80f8bbf4) - Respect `cacheDir` when optimizer is enabled - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6910 [<samp>(0b08b)</samp>](vitest-dev/vitest@0b08bc11) - Reset runningPromise after `finally` in case there is an error to avoid it getting stuck - by [
Description
Goals of this PR:
core.ts@internalto remove them from typesThe new API without deprecated methods:
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.