Releases: vitest-dev/vitest
Releases · vitest-dev/vitest
v0.31.1
🚀 Features
- watch: Press
r
should rerun current pattern tests - by @Dunqing and @AriPerkkio in #3305 (69d27)
🐞 Bug Fixes
- Make sure thrown error is an object - by @sheremet-va in #3298 (a93be)
- Remove duplicate type - by @sheremet-va in #3303 (5382e)
- Throw an error, if tests are collected with a different vitest version - by @sheremet-va in #3301 (708b1)
- Support application/x-gzip metadata in html report - by @mzanelee and Michael Lee in #3333 (5bf7e)
- Correctly restore vi.fn implementation - by @sheremet-va in #3341 (2aff8)
- Display error message correctly - by @btea in #3314 (a5b3d)
- Exclude
cwd
from test name filter - by @AriPerkkio in #3353 (324a9) - Check error type before modifying it - by @sheremet-va in #3385 (c44d9)
toMatchInlineSnapshot
fails when file path includes parentheses - by @pacexy in #3370 and #3371 (dcf13)- Stop spying on a method, when it's restored - by @sheremet-va in #3386 (2cb1a)
- Test repeats - by @fenghan34 in #3369 (fb8fc)
- browser:
- Throw an error if test failed to load - by @sheremet-va in #3390 (b354b)
- Keep default export when rewriting exports - by @sheremet-va in #3389 (6501d)
- cli:
- Improve cac errors when mixing boolean and dot notation - by @AriPerkkio in #3302 (93fbd)
- reporter:
- Prevent deleting test reports stored in coverage directory - by @AriPerkkio in #3331 (ddbba)
- typecheck:
- Correctly resolve custom tsconfig path - by @sheremet-va in #3342 (c53ae)
- vite-node:
- Allow returning id not wrapped in promise - by @danielroe in #3312 (9836c)
View changes on GitHub
v0.31.0
🚨 Breaking Changes
-
Remove
browser
from allowed pools insidepoolMatchGlob
config option. Please, use Vitest workspaces for running tests in the browser. -
Move assertion declarations to expect package - by @sheremet-va in #3294 (cf3af)
- The change should be minor:
- declare namespace Vi { + declare module 'vitest' { interface Assertion<T = any> extends CustomMatchers<T> {} interface AsymmetricMatchersContaining extends CustomMatchers {} }
🚀 Features
- Update mock implementation to support ESM runtime, introduce "vi.hoisted" - by @sheremet-va in #3258 (0c09a)
- Bypass ESM import order restriction with
vi.hoisted
to run code before imports are executed:
You can also use it to pass variables tovi.hoisted(() => vi.setSystemTime(new Date(2022, 1, 1)))
vi.mock
:const { mockedMethod } = vi.hoisted(() => { return { mockedMethod: vi.fn() } }) vi.mock('./path/to/module.js', () => { return { originalMethod: mockedMethod } })
- Bypass ESM import order restriction with
- Add repeat method to tests - by @samkevin1 in #2652 (7c8f0)
- Add an option to hide skipped test lines - by @g4rry420 and @sheremet-va in #2745 (9bdb1)
- coverage: Watermarks for c8 - by @AriPerkkio in #3254 (730af)
- ui: Add html coverage - by @userquin and @sheremet-va in #3071 (e24cd)
- watch: Test run cancelling, feat:
--bail
option for cancelling test run - by @AriPerkkio in #3163 (8d460)
🐞 Bug Fixes
- Don't call global setup teardown twice - by @sheremet-va in #3188 (ba3d1)
- Reporter to log version before provider initalizations - by @AriPerkkio in #3131 (481b1)
- Throw an error if Vitest cannot access its internal state - by @sheremet-va in #3250 (fbb14)
- Warning suppression broken - by @IceQub3 in #3270 and #3271 (036de)
- Show correct diff in "toHaveBeenCalledWith" - by @sheremet-va in #3289 (19fcd)
- Don't print esm warning, if package name is not found - by @sheremet-va in #3292 (62c14)
- Support exactOptionalPropertyTypes - by @sheremet-va in #3293 (ba81d)
- Don't inline vite hmr and rollup types - by @sheremet-va in #3291 (1f118)
- browser:
- coverage:
thresholdAutoUpdate
to work withperFile
- by @AriPerkkio in #3182 (29eeb)- Throw error if fail to load built-in provider - by @AriPerkkio in #3217 (0a287)
- Stackblitz hangs with c8 - by @AriPerkkio in #3225 (d9fda)
- C8 to ignore vite's generated helpers - by @AriPerkkio in #3241 (21942)
- Workspaces c8 source maps - by @AriPerkkio in #3226 (efce3)
- docs:
- Correct typo and broken link to WebdriverIO - by @nathanbabcock in #3275 (c7da1)
- spy:
- vite-node:
- vitest:
- Also check for vite relative to vitest package - by @JoshuaKGoldberg and @sheremet-va in #3274 (a3393)
- watch:
- Run test files when added to filesystem - by @AriPerkkio in #3189 (7b2c8)
View changes on GitHub
v0.30.1
🐞 Bug Fixes
- Do not rely on global
performance
andAggregateError
- by @sheremet-va in #3171 (cce45) - Allow workspace without a config in the root - by @sheremet-va in #3173 (06852)
test.each
respectschaiConfig
- by @sheremet-va (4f6c1)- Use relative paths in source map's "sources" field - by @sheremet-va in #3177 (6b1b4)
- types:
- Allow augmenting jest namespace for custom assertions - by @sheremet-va in #3169 (905ec)
- Publish utils and snapshot .d.ts files for typescript - by @sheremet-va in #3172 (7af64)
- snapshot:
View changes on GitHub
v0.30.0
🚨 Breaking Changes
- Remove tinyspy internal properties on Vitest spies - by @sheremet-va in #3069 (2f1dc)
- Only support Node.js 14.18.0 or newer - by @danez in #2985 (287dc)
- Use "concordance" package to display diff instead of using custom diff - by @sheremet-va in #2828 (44630)
- Move snapshot implementation into @vitest/snapshot - by @sheremet-va in #3032 (6aff0)
- Bump coverage packages vitest peer dependency - by @AriPerkkio in #3126 (be1bf)
- Add workspace support - by @sheremet-va in #3103 (b9d1a)
- Experimental optimizer introduced in 0.29.0 is temporarily disabled.
🚀 Features
- Gzip html reporter's metadata - by @7rulnik in #3113 (7856e)
- Add chai config - by @btea in #3066 (6fcba)
- snapshot: Introduce
toMatchFileSnapshot
and auto queuing expect promise - by @antfu in #3116 (bdc06)
🐞 Bug Fixes
- Resolve reporters passed down to the CLI relative to the running directory - by @sheremet-va in #3097 (93c7e)
- Don't show "diff" in "serialized error" section - by @sheremet-va (326b2)
- Convert '--single-thread' and '--inspect' cli args to boolean - by @AriPerkkio in #3111 (83a9a)
- Stack trace point to incorrect file - by @ChenKS12138 and @sheremet-va in #3004 and #3115 (5cee4)
- Run benchmarks sequentially - by @thecodrr in #2004 and #3151 (430b4)
View changes on GitHub
v0.29.8
🚀 Features
- Allow accessing "vi" methods without context, don't fail when mocker is not available - by @sheremet-va in #3047 (1531c)
- Show browser console in the terminal - by @sheremet-va in #3048 (ee6f5)
- Playwright as browser provider - by @Aslemammad and @sheremet-va in #3079 (9dc69)
- Implement
istanbul
coverage support for browser testing - by @sheremet-va and @AriPerkkio in #3040 (0f44d)
🐞 Bug Fixes
- Add generic to expect.objectContaining type - by @ArtyMaury in #3053 (69d2c)
- Do not fail, when primitive error is thrown - by @sheremet-va in #3074 (6efe6)
- Handle cloning proxied classes w/ enumerable getters - by @tgriesser in #3026 (196a0)
- Spy on popup apis like alert - by @Aslemammad and @sheremet-va in #3076 (280ad)
- Report coverage even when no tests found - by @AriPerkkio in #3091 (2cb91)
View changes on GitHub
v0.29.7
🐞 Bug Fixes
- Import @vite/client in browser code for handling optimizer - by @sheremet-va (20c51)
View changes on GitHub
v0.29.6
v0.29.5
🐞 Bug Fixes
- browser: Relax vitest peer dependency - by @cexbrayat in #3039 (865d1)
View changes on GitHub
v0.29.4
🚀 Features
--test-timeout
CLI argument - by @AriPerkkio in #3019 (63c62)- Add an option to control Vitest pool with filepath - by @sheremet-va in #3029 (c7f0c)
- Process timeout to log names of stuck test files - by @AriPerkkio in #3031 (0ddf7)
- Support relative path in html report - by @poyoho and @sheremet-va in #2695 (a7680)
- Webdriverio (+ custom providers) integration for browser mode - by @Aslemammad, Christian Bromann, @sheremet-va, @userquin and @dammy001 in #2999 (9cdc8)
🐞 Bug Fixes
- Show correct line numbers in stack trace when using vi.resetModules() - by @sheremet-va in #3020 (35730)
- Mocking value proxy filter Symbol static properties - by @ChpShy in #3036 (0cf44)
- Escape XML in error stack trace when using junit reporter - by @sheremet-va in #3038 (cc577)
View changes on GitHub
v0.29.3
🚀 Features
- Use custom colors implementation instead of picocolors - by @sheremet-va (427b0)
- Uncaught errors to indicate env teardown - by @AriPerkkio in #2982 (1fe82)
- config: Add an option to run setupFiles in sequence - by @sheremet-va in #3008 (c2e25)
🐞 Bug Fixes
- Console log not visible - by @AriPerkkio in #2943 (02808)
- Remove duplicate execArgv when deps.registerNodeLoader: true - by @AriPerkkio in #2965 (a1954)
- Prevent running test cases timers after environment teardown - by @AriPerkkio in #2971 (bde75)
- Don't mark setupFiles as test files, if experimentaOptimizer is used - by @sheremet-va in #2974 (819c6)
- Config errors not visible - by @AriPerkkio in #2995 (f01c7)
- --inspect to work inside workers - by @AriPerkkio in #2983 (36087)
- types: Use
any
as default value for TArgs in vi.fn() - by @jessevanassen in #2947 (1bdcc)
🏎 Performance
- reporters: Overall improvements - by @AriPerkkio in #3006 (22ca0)