v5.0.0-rc.1Pre-release
Added 4
- Support nested projects
- Report the duration breakdown as percentages
- Support -p shorthand for --project in CLI
- Support require(esm) in vm pools
Changed 8
- Inline projects extend the root config by default
- Enable mocking Temporal without fake timers
- Use > as separator in -t and calculate only once
- Fail the test when an asynchronous assertion is not awaited
- Share the Vite server between inline projects
- Save failure screenshots in attachmentsDir in browser mode
- Preserve class mock prototype methods on instances in spy
- Add better promise support in expects and matchers in types
Fixed 8
- Coalesce concurrent watch-mode restarts
- Prevent vitest --typecheck from reporting false success when tsc process crashes
- Collect in-source tests when the module is cached
- Swap replace() arguments so timeout error stack shows the real message
- Fix stale mock metadata breaking automocking with isolate:false
- Don't lose worker output on teardown
- Ignore channel events in a tester opened as a top-level window in browser mode
- Resolve connectTimeout from the project config in browser mode
🚨 Breaking Changes
- Inline projects extend the root config by default - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10750 (fec00)
- Enable mocking Temporal without fake timers - by @fabon-f, Hiroshi Ogawa and OpenCode in https://github.com/vitest-dev/vitest/issues/10757 (ac2d4)
- Support nested projects - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10846 (ec367)
- Use
>as separator in-t, calculateonlyonce - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10686 (a0b20) - Fail the test when an asynchronous assertion is not awaited - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10868 (86d4a)
- Share the Vite server between inline projects - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10848 (d87c9)
- browser: Save failure screenshots in
attachmentsDir- by @macarie in https://github.com/vitest-dev/vitest/issues/10917 (3b5bb) - spy: Preserve class mock prototype methods on instances - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10910 (6093d)
- types: Add better promise support in expects and matchers - by @samchungy and @sheremet-va in https://github.com/vitest-dev/vitest/issues/8266 (41f55)
🚀 Features
- Report the duration breakdown as percentages - by @sheremet-va and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10820 (c67d2)
- cli: Support -p shorthand for --project - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10826 (1addd)
- vm: Support
require(esm)in vm pools - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10829 (01298)
🐞 Bug Fixes
- Coalesce concurrent watch-mode restarts, deflake the pool stderr fixture - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10822 (a31f8)
- Prevent
vitest --typecheckfrom reporting a false success when thetscprocess crashes - by @hitenkalda and Hiten Kalda in https://github.com/vitest-dev/vitest/issues/10705 (a1b05) - Collect in-source tests when the module is cached - by @koutaro-masaki in https://github.com/vitest-dev/vitest/issues/10577 and https://github.com/vitest-dev/vitest/issues/10589 (a7bf2)
- Swap replace() arguments so timeout error stack shows the real message - by @lazerg in https://github.com/vitest-dev/vitest/issues/10875 (aba0f)
- Stale mock metadata breaks automocking with isolate:false - by @kade-robertson in https://github.com/vitest-dev/vitest/issues/10145 and https://github.com/vitest-dev/vitest/issues/10541 (8e210)
- Don't lose worker output on teardown, deflake timing-sensitive tests - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10842 (1216b)
- browser:
- Ignore channel events in a tester opened as a top-level window - by @simshanith in https://github.com/vitest-dev/vitest/issues/9379 and https://github.com/vitest-dev/vitest/issues/9381 (46a3c)
- Resolve
connectTimeoutfrom the project config - by @lazerg in https://github.com/vitest-dev/vitest/issues/10879 and https://github.com/vitest-dev/vitest/issues/10880 (62c79) - Prebundle vite module runner with vitest - by @lebovvskii and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10836 and https://github.com/vitest-dev/vitest/issues/10856 (37c24)
- Restore dependency reload warning - by @hi-ogawa, Hiroshi Ogawa and OpenCode in https://github.com/vitest-dev/vitest/issues/10913 (90d69)
- Configure internal optimizer dependencies - by @hi-ogawa, Hiroshi Ogawa and OpenCode in https://github.com/vitest-dev/vitest/issues/10915 (a72f4)
- cache:
- Improve
fsModuleCacheresiliency during external modifications - by @jszumski in https://github.com/vitest-dev/vitest/issues/10869 (5eb35)
- Improve
- cli:
- Exit on
CTRL+ceven whenglobalSetupruns blocked code - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/10863 (d568f)
- Exit on
- deps:
- Update all non-major dependencies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/9958 (7faa7)
- Update all non-major dependencies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10861 (0188c)
- Update all non-major dependencies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10898 (61c4b)
- expect:
- Handle nullish toHaveProperty values - by @liyimil in https://github.com/vitest-dev/vitest/issues/10735 and https://github.com/vitest-dev/vitest/issues/10811 (99e59)
- reporters:
- Print parent describe suites when the passed-test list is hidden - by @ChihebBENCHEIKH1, Chiheb Bencheikh and @sheremet-va in https://github.com/vitest-dev/vitest/issues/10606 and https://github.com/vitest-dev/vitest/issues/10768 (658af)
- runner:
- Don't fail collection when accessing
error.stackthrows - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10839 (202e2)
- Don't fail collection when accessing
- spy:
- Point ESM namespace spy error to module mocking docs - by @ryandiginomad and Ryan Tang in https://github.com/vitest-dev/vitest/issues/10707 (d6cec)
- typecheck:
- Report a checker crash on Windows instead of a spawn failure - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10907 (77aac)
- vitest:
- Remove broken "./src/*" export from package.json - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10918 (2e5df)
- vm:
- Stop retaining every finished test file in vm pool workers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10854 (38503)
🏎 Performance
- Lowers peak memory usage when using
--changedon a large graph - by @jszumski in https://github.com/vitest-dev/vitest/issues/10866 (9f23f) - browser: Serve framework assets as immutable - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/10729 (7af87)