Releases: vitest-dev/vitest
Releases · vitest-dev/vitest
v4.0.0-beta.5
🚨 Breaking Changes
- Use module-runner instead of vite-node - by @sheremet-va and @AriPerkkio in #8208 (9be01)
- runner: Set mode to
todo
if no function is passed down totest
ordescribe
- by @sheremet-va in #8346 (1a81c)
🐞 Bug Fixes
- Invalidate modules in all module graphs when the file is changed - by @sheremet-va in #8352 (94ab3)
- wdio: Properly construct the shadow root selector if there are multiple elements - by @sheremet-va in #8354 (28765)
View changes on GitHub
v4.0.0-beta.4
🚀 Features
- browser:
🐞 Bug Fixes
- Add
--changed
flag support tovitest list
command - by @haakonjackfloat in #8270 and #8272 (e71a5) - Prevent rpc timeout on slow thread blocking synchronous methods - by @AriPerkkio and @sheremet-va in #8297 (bea87)
- Forbid setting environment to
browser
- by @sheremet-va in #8334 (0417a) - deps: Update all non-major dependencies - in #8328 (aa79e)
- wdio: Wait for the driver to be properly closed - by @sheremet-va in #8305 (c16ab)
View changes on GitHub
v4.0.0-beta.3
🚨 Breaking Changes
- Remove deprecated
workspace
option in favor ofprojects
- by @sheremet-va in #8218 (76fb7) - Ignore
--standalone
when CLI filename filter is used - by @AriPerkkio in #8262 (013bf)
🚀 Features
- Add spy option to vi.mockObject - by @rChaoz in #8285 (81d76)
- browser: Support
toBeInViewport
utility method to assert element is in viewport or not - by @Shinyaigeek in #8234 (ceed5) - expect: Support
toBeNullable
expect function to check provided value is nullish - by @Shinyaigeek and @sheremet-va in #8294 (eeec5) - mocker: Add
automocker
entry - by @sheremet-va in #8301 (e9c92)
🐞 Bug Fixes
- Remove unused dependencies - by @AriPerkkio in #8184 (feadc)
- Distribute test files to shards more evenly - by @Shinyaigeek and @AriPerkkio in #8288 (7b489)
- Use suite's timeout when
test.extend
- by @AriPerkkio in #8278 (43977) - Support snapshot with no object key sorting - by @hi-ogawa and @sheremet-va in #8136 (e85e3)
- Annotation location always points to the test file - by @sheremet-va in #8315 (88071)
- core:
- Fix
objectContaining
expect utility to have more compatibility to jest's one - by @Shinyaigeek in #8241 (480be)
- Fix
- coverage:
- Include files based on
--project
filter - by @gtbuchanan in #7885 (761be) - Prevent encoding filenames of uncovered files - by @AriPerkkio in #8239 (8a998)
- Include files based on
- deps:
- Update all non-major dependencies - by @sheremet-va in #8235 (a1e57)
- mocker:
- reporter:
- Invisible CLI menus when
vitest --standalone
- by @AriPerkkio in #8248 (37cc2)
- Invisible CLI menus when
- rolldown-vite:
- Properly disable minifier in the browser client - by @sheremet-va in #8306 (f55bb)
- watch:
- Filename filter runs duplicate tests in workspaces - by @AriPerkkio in #8250 (932d8)
View changes on GitHub
v4.0.0-beta.2
🚨 Breaking Changes
- Remove support for Vite 5 - by @sheremet-va in #8202 (cb8b0)
- Remove deprecated types - by @sheremet-va in #8203 (66bee)
- Remove deprecated environmentMatchGlobs and poolMatchGlobs - by @sheremet-va in #8205 (be11d)
- snapshot: Fail test with obsolete snapshot on CI - by @hi-ogawa in #7963 (4d84f)
- spy: Support spying on classes - by @sheremet-va in #6160 (abc0d)
🚀 Features
- Add
onUnhandledError
callback - by @sheremet-va in #8162 (924cb)
🐞 Bug Fixes
- Allow overriding globals in types - by @sheremet-va in #8215 (2248b)
- browser: Run in-source tests only when the file itsels is a test file - by @sheremet-va in #8204 (bdd2e)
View changes on GitHub
v4.0.0-beta.1
🚨 Breaking Changes
- Remove
'basic'
reporter - by @AriPerkkio in #7884 (82fcf) - Simplify default exclude pattern - by @sheremet-va in #6287 (14c50)
- Remove deprecated getSourceMap - by @sheremet-va in #8194 (ff934)
- Replace deprecated ErrorWithDiff with TestError - by @sheremet-va in #8195 (da59e)
- Remove UserConfig type in favor of ViteUserConfig - by @sheremet-va in #8196 (22f7f)
- Remove deprecated coverage options in favor of
vitest/node
exports - by @sheremet-va in #8197 (dc848) - Remove deprecated internal helpers and environment exports - by @sheremet-va in #8198 (4703c)
- Remove deprecated typecheck and runner types - by @sheremet-va in #8199 (89a1c)
- Remove Node types from the main entry point, use
vitest/node
instead - by @sheremet-va in #8200 (1e60c) - coverage:
- V8 to support only AST based remapping by @AriPerkkio in #8064 (176133e)
- Remove
.all
, reworkedinclude/exclude
by @AriPerkkio in #7837 (41a111c)
🚀 Features
- Provide entity to onConsoleLog - by @sheremet-va in #8159 (437d4)
🐞 Bug Fixes
View changes on GitHub
v3.2.4
🐞 Bug Fixes
- Use correct path for optimisation of strip-literal - by @mrginglymus in #8139 (44940)
- Print uint and buffer as a simple string - by @sheremet-va in #8141 (b86bf)
- browser:
- Show a helpful error when spying on an export - by @sheremet-va in #8178 (56007)
- cli:
vitest run --watch
should be watch-mode - by @AriPerkkio in #8128 (657e8)- Use absolute path environment on Windows - by @colinaaa in #8105 (85dc0)
- Throw error when
--shard x/<count>
exceeds count of test files - by @AriPerkkio in #8112 (8a18c)
- coverage:
- Ignore SCSS in browser mode - by @sheremet-va in #8161 (0c3be)
- deps:
- expect:
- pool:
- Auto-adjust
minWorkers
when onlymaxWorkers
specified - by @AriPerkkio in #8110 (14dc0)
- Auto-adjust
- reporter:
task.meta
should be available in custom reporter's errors - by @AriPerkkio in #8115 (27df6)
- runner:
- Preserve handler wrapping on extend - by @pengooseDev in #8153 (a9281)
- ui:
View changes on GitHub
v3.2.3
🚀 Features
- browser: Use base url instead of vitest - by @sheremet-va in #8126 (1d8eb)
- ui: Show test annotations and metadata in the test report tab - by @sheremet-va in #8093 (c69be)
🐞 Bug Fixes
- Rerun tests when project's setup file is changed - by @sheremet-va in #8097 (0f335)
- Revert
expect.any
return type - by @sheremet-va in #8129 (47514) - Run only the name plugin last, not all config plugins - by @sheremet-va in #8130 (83862)
- pool:
- Throw if user's tests use
process.send()
- by @AriPerkkio in #8125 (dfe81)
- Throw if user's tests use
- runner:
- Fast sequential task updates missing - by @AriPerkkio in #8121 (7bd11)
- Comments between fixture destructures - by @AriPerkkio in #8127 (dc469)
- vite-node:
- Unable to handle errors where sourcemap mapping empty - by @blake-newman and @hi-ogawa in #8071 (8aa25)
View changes on GitHub
v3.2.2
🚀 Features
- Support rolldown-vite - by @sheremet-va and @hi-ogawa in #7509 (c8d62)
🐞 Bug Fixes
- browser:
- Calculate prepare time from
createTesters
call on the main thread - by @sheremet-va in #8101 (142c7) - Optimize build output and always prebundle vitest - by @sheremet-va (00a39)
- Make custom locators available in
vitest-browser-*
packages - by @sheremet-va in #8103 (247ef)
- Calculate prepare time from
- expect:
- reporter:
- Allow
dot
reporter to work in non interactive terminals - by @bstephen1 and @AriPerkkio in #7994 (6db9f)
- Allow
View changes on GitHub
v3.2.1
🐞 Bug Fixes
- Use sha1 instead of md5 for hashing - by @sheremet-va (e4c73)
- expect:
View changes on GitHub
v3.2.0
🚀 Features
- Provide
ctx.signal
- by @sheremet-va in #7878 (e761f) - Support custom colors for
test.name
- by @AriPerkkio in #7809 (4af5d) - Add
vi.mockObject
to automock any object - by @hi-ogawa and @sheremet-va in #7761 (465bd) - Introduce
watchTriggerPatterns
option - by @sheremet-va in #7778 (a0675) - Deprecate
workspace
in favor ofprojects
- by @sheremet-va and @AriPerkkio in #7923 (41beb) - Explicit Resource Management support in mocked functions - by @EskiMojo14 in #7927 (b67d3)
- Add
sequence.groupOrder
option - by @sheremet-va in #7852 (d1a1d) - Initial support for Temporal equality - by @dirkluijk in #8007 (52bd7)
- Support Vite 7 - by @sheremet-va in #8003 (1716b)
- Track module execution totalTime and selfTime - by @abrenneke in #8027 (95961)
- Annotation API - by @sheremet-va in #7953 (b03f2)
- browser:
- Implement
connect
option forplaywright
browser provider - by @egfx-notifications and @sheremet-va in #7915 (029c0) - Add
screenshot.save
option - by @sheremet-va in #7777 (d9f51) - Custom locators API - by @sheremet-va in #7993 (e6fbd)
- Implement
- coverage:
- V8 experimental AST-aware remapping - by @AriPerkkio in #7736 (78a3d)
- reporter:
- Add
onWritePath
option togithub-actions
- by @nwalters512 and @AriPerkkio in #8015 (abd3b)
- Add
- vitest:
- Allow per-file and per-worker fixtures - by @sheremet-va and @AriPerkkio in #7704 (9cbfc)
🐞 Bug Fixes
- Replace
micromatch
withpicomatch
- by @sapphi-red in #7951 (df076) - Try to catch unhandled error outside of a test - by @sheremet-va in #7968 (46421)
- Generate a separate config for "vitest init browser" instead of a workspace file - by @sheremet-va in #7934 (e84e2)
- Switch ExpectStatic
any
types toAsymmetricMatcher<unknown>
, withDeeplyAllowMatchers<T>
- by @JoshuaKGoldberg in #7016 (8ec44) - Remove unused exports - by @sheremet-va in #7618 (33d05)
- Throw an error if typechecker failed to spawn - by @sheremet-va in #7990 (0e960)
- Ignore non-string
stack
properties - by @sheremet-va in #7995 (330f9) - Apply browser CLI options only if the project has the browser set in the config already - by @sheremet-va in #7984 (70358)
- Ensure errors keep their message and stack after
toJSON
serialisation - by @sheremet-va in #8053 (3bdf0) - browser:
- Resolve FS commands relative to the project root - by @sheremet-va in #7896 (69ac9)
- Run tests serially if provider doesn't provide a mocker - by @sheremet-va in #8032 (227a9)
- Resolve
upload
files relative to the project root - by @sheremet-va in #8042 (b9a31) - Await mocker invalidation to avoid race condition with "mock wasn't registered" - by @sheremet-va in #8021 (b34ff)
- Share vite cache with the project cache - by @sheremet-va in #8049 (0cbad)
- Add
this
type tolocators.extend
- by @sheremet-va in #8069 (70fb0)
- cache:
- cli:
- Add built-in reporters list to --help output - by @pengooseDev in #7955 (ef6ef)
- Parse
--silent
values properly - by @AriPerkkio in #8055 (8fad7)
- coverage:
- Istanbul provider to not use Vite preserved query params - by @AriPerkkio in #7939 (a05d4)
- Browser + v8 in source tests missing - by @AriPerkkio in #7946 (51cd8)
- In-source test cases excluded - by @AriPerkkio in #7985 (407c0)
- dev:
- Fix relay of custom equality testers - by @StefanLiebscher in #6140 (6dc1d)
- expect:
- Unbundle
@types/chai
- by @hi-ogawa in #7937 (525f5) - Support type-safe declaration of custom matchers - by @kettanaito and @sheremet-va in #7656 (e996b)
- Unbundle
- reporters:
- Check the test result again when tests are rerunning - by @sheremet-va in #8063 (35e31)
- spy:
- Copy over static properties from the function - by @sheremet-va in #7780 (9b9f0)
- typecheck:
- Don't panic during
vitest list
command - by @sheremet-va in #7933 (ba6da) - Avoid creating a temporary tsconfig file when typechecking - by @sheremet-va in #7967 (34f43)
- Don't panic during
- vite-node:
- vitest:
- Adjust
getWorkerMemoryLimit
priority for vmForks - by @pe...
- Adjust