v3.0.0-beta.1
版本发布时间: 2024-12-06 01:34:20
vitest-dev/vitest最新发布版本:v3.0.0-beta.2(2024-12-10 18:22:19)
We decided to skip Vitest 2.2 and release Vitest 3 with support for Vite 6 instead. There will be no more Vitest 2 versions. Vitest 3 is the first version that supports Vite 6 (excluding 2.1.6). We aim to have a stable release in January.
Vitest 3 is our first step to standardising the public Node.js API. We plan to remove the experimental tag from the current APIs in Vitest 3.1 - the API will follow semver after that.
🚨 Breaking Changes
-
spy.mockReset
changes - by @Lordfirespeed in https://github.com/vitest-dev/vitest/issues/6426 (db7a8) - Pass down context to test hooks - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/7034 (82c2e)
- Support Vite 6 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/7026 (7abe8)
-
runner: Support
describe(..., { shuffle: boolean })
and inherit from parent suite - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6670 (aa1da) -
snapshot: Reset snapshot state for
retry
andrepeats
- by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6817 (e8ce9) - vitest: Don't expose default toFake config - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6288 (e3144)
🚀 Features
- Support inline
diff
options and supportprintBasicPrototype
- by @hi-ogawa, @sheremet-va and Michał Grzegorzewski in https://github.com/vitest-dev/vitest/issues/6740 (39186) - Allow a custom note when calling
ctx.skip()
dynamically - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6805 (697c3) - Allow inline workspace configuration - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6923 (562e1)
- Provide the current project to the global setup - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6942 (a5bbc)
- Print project name as a label - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6925 (a3bef)
- Print a deprecation warning if suite or test uses object as the third argument - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/7031 (407f1)
-
browser:
- Support
actionTimeout
as playwright provider options - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6984 (e2c29)
- Support
-
cli:
- Support excluding projects with
--project=!pattern
- by @haines in https://github.com/vitest-dev/vitest/issues/6924 (ebfe9) - Support specifying a line number when filtering tests - by @mzhubail and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6411 (4d94b)
- Support excluding projects with
-
expect:
- Add
toHaveBeenCalledExactlyOnceWith
expect matcher - by @jacoberdman2147 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6894 (ff662) - Add
toHaveBeenCalledAfter
andtoHaveBeenCalledBefore
utility - by @Barbapapazes and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6056 (85e6f)
- Add
-
reporter:
- Add support for function type to classname option in the junit reporter - by @jpleclerc, Jean-Philippe Leclerc and @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6839 (dc238)
-
reporters:
-
summary
option forverbose
anddefault
reporters - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6893 (511b7)
-
-
runner:
- Test context can inject values from the config's
provide
- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6813 (85c64)
- Test context can inject values from the config's
-
snapshot:
- Provide
config
toresolveSnapshotPath
- by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6800 (746d8)
- Provide
-
ui:
- Allow run individual tests/suites from the UI - by @userquin in https://github.com/vitest-dev/vitest/issues/6641 (d9cc8)
-
vitest:
- Include
coverageMap
in json report - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6606 (9c8f7) - Add
onTestsRerun
method to global setup context - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6803 (e26e0)
- Include
🐞 Bug Fixes
- Misc fix for vite 6 ecosystem ci - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6867 (80f8b)
- Respect
cacheDir
when optimizer is enabled - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6910 (0b08b) - Reset runningPromise after
finally
in case there is an error to avoid it getting stuck - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6951 (02194) - Support Node 21 - by @sheremet-va (92f7a)
- Don't use
Custom
internally - by @sheremet-va (46fc5) -
browser:
- Improve source maps when
vi.mock
is present - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6810 (8d179) - Explain TypeScript support in docs and add asymmetric matchers to types - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6934 (ac1a7)
- Fix matchers.d.ts - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6995 (a485b)
- Improve source maps when
-
coverage:
- Exclude browser mode iframe results - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6905 (e04a1)
-
junit:
- Fix testsuites time to be sum of all testsuite items - by @saitonakamura in https://github.com/vitest-dev/vitest/issues/6985 (ca37a)
-
pretty-format:
- Support react 19 - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6909 (bd29b)
-
reporters:
- Write buffered stdout/stderr on process exit - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6932 (80cde)
- Rewrite
dot
reporter withoutlog-update
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6943 (be969) - Check
--hideSkippedTests
in base reporter - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6988 (721a5) - Show
retry
andrepeats
counts - by @AriPerkkio and @hi-ogawa in https://github.com/vitest-dev/vitest/issues/7004 (3496a)
-
typecheck:
- Fix typecheck collect on Vite 6 - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6972 (7b35d)
-
types:
- Make parameters non-nullable for Playwright options - by @apple-yagi in https://github.com/vitest-dev/vitest/issues/6989 (fe2a1)
-
vite-node:
- Fix error stack on Windows - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6786 (bf7b3)