chore(deps): update dependency @vitest/coverage-c8 to ^0.33.0 - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
@vitest/coverage-c8 (source) | devDependencies | minor | ^0.22.1 -> ^0.33.0 |
Release Notes
vitest-dev/vitest (@vitest/coverage-c8)
v0.33.0
🚨 Breaking Changes
- Revert default include patterns - by @so1ve #3729
-
0.32.0
changed the defaultinclude
globs to be compatible with Jest. After a discussion with the community, we are reverting this change because it turned out to be non-intuitive.
-
🐞 Bug Fixes
- Add missing JSDom living keys - by @DerZade in https://github.com/vitest-dev/vitest/issues/3702 (83a86)
-
vite-node:
- Don't fail when importing Promise module - by @sheremet-va (08192)
- Allow importing node:test - by @sheremet-va (db22c)
View changes on GitHub
v0.32.4
🐞 Bug Fixes
- browser: Correctly optimize CJS dependencies - by @sheremet-va (3d090)
View changes on GitHub
v0.32.3
🚀 Features
- Add
concurrent
option tosequence
config - by @fenghan34 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3604 (f427f) - Introduce global configuration for retry setting - by @imentu and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3598 and https://github.com/vitest-dev/vitest/issues/3603 (9a117)
- Don't rely on util package in @vitest/utils - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3685 (f91da)
- Support accessing other fixtures in fixture function - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3651 (1621c)
- Support use function/class as
bench
name - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3711 (a749a) - reporters: Show full test suite when testing 1 spec file at a time - by @Dunqing in https://github.com/vitest-dev/vitest/issues/3543 (7531c)
-
runner: Support
test.extend
- by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3554 (2db1a)
🐞 Bug Fixes
- Remove "concordance" from dependencies list - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3597 (969dc)
- Show diff correctly - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3620 (73dd4)
- Util import - by @fubhy in https://github.com/vitest-dev/vitest/issues/3621 (2fb4c)
- Compat with frozen Math - by @turadg in https://github.com/vitest-dev/vitest/issues/3527 (0db67)
-
CTRL+C
to terminate run - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3642 (fa663) - Run mode stuck in TTY terminals - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3690 (141a8)
- Use first stack frame in json reporter - by @tim-smart in https://github.com/vitest-dev/vitest/issues/3645 (80ea7)
- Print actual number for
toBeCalledTimes
- by @antfu in https://github.com/vitest-dev/vitest/issues/3696 (d3640) -
benchmark:
- Don't fail when running correct benchmarks - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3629 (edad9)
-
browser:
- Correctly print diff - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3627 (d756e)
- Esm injector doesn't replace class expressions - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3641 (5c0ac)
- Transform superclass identifier - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3681 (a1e04)
-
coverage:
-
v8
to prevent crash on dynamic CJS files - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3657 (40f18)
-
-
runner:
- Make the default value of
retry
andrepeats
0 - by @Dunqing in https://github.com/vitest-dev/vitest/issues/3638 (6d146)
- Make the default value of
-
utils:
- Respect all flags in format function - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3695 (91e16)
-
watch:
- Cancel using
h
key - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3618 (60c36)
- Cancel using
View changes on GitHub
v0.32.2
🐞 Bug Fixes
- browser: Don't fail on importing diff-sequences - by @sheremet-va (00b0e)
View changes on GitHub
v0.32.1
🚀 Features
- Export
registerConsoleShortcuts
fromvitest/node
- by @deot in https://github.com/vitest-dev/vitest/issues/3563 (bc49b) -
expect: Support
expect.unreachable
- by @fenghan34 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3556 (8e385) -
runner:
describe
/test
name support anonymous function - by @btea in https://github.com/vitest-dev/vitest/issues/3562 (3d436)
🐞 Bug Fixes
- Avoid call stack recursion with large error (fix: #3060) - by @nathanmmiller and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3078 and https://github.com/vitest-dev/vitest/issues/3060 (02196)
- Automatically remove define related configuration - by @btea in https://github.com/vitest-dev/vitest/issues/3552 (368b8)
- Import
performance
fromperf_hooks
- by @Max10240 and wangbaolong.wbl in https://github.com/vitest-dev/vitest/issues/3578 and https://github.com/vitest-dev/vitest/issues/3579 (24ec8) - Revert concordance diff, use jest's diff output - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3582 (9c7ea)
- Typo in config suggestion - by @Krisell in https://github.com/vitest-dev/vitest/issues/3583 (68985)
-
browser:
- Change optimized deps to use
vitest
- by @userquin in https://github.com/vitest-dev/vitest/issues/3580 (b4ac8) - Access vi_inject only if it was injected - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3587 (d9e14)
- Change optimized deps to use
-
mocker:
- Respect namespace import when hoisting vi.mock - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3547 (158c4)
-
ui:
- Navigate to dashboard when re-running tests from coverage page - by @userquin in https://github.com/vitest-dev/vitest/issues/3529 (bc283)
-
vite-node:
- Correctly resolve virtual modules - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3544 (0cbb0)
- Fix errors caused by commonjs export circular references - by @rxliuli in https://github.com/vitest-dev/vitest/issues/3570 (b097c)
View changes on GitHub
v0.32.0
🚨 Breaking Changes
- Throw an error, if the module cannot be resolved - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3307 (1ad63)
- Vitest used to fall back to the original import when it could not resolve it to the file path or the virtual module. This leads to hard-to-find module graph mismatches if you had incorrect alias or relied on relative imports to be resolved to the project root (which is usual behavior in TypeScript) because the code accidentally "worked". With this release, Vitest will now throw an error if it cannot resolve the module - there are possible edge cases that are not covered yet, so if you have any problems with this, please open a separate issue with reproduction.
- Improve globs - by @nickmccurdy in https://github.com/vitest-dev/vitest/issues/3392 (19ecc)
- Vitest now has glob patterns similar to Jest for better compatibility. It's possible that some files will be considered test files when previously they were not. For example, Vitest now considers
test.js
to be a test file. Also any file in__tests__
is now considered to be a test, not just files withtest
orspec
suffix.
- Vitest now has glob patterns similar to Jest for better compatibility. It's possible that some files will be considered test files when previously they were not. For example, Vitest now considers
- Add
@vitest/coverage-v8
package - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3339 (82112)- Vitest now uses v8 code coverage directly for better performance.
@vitest/coverage-c8
is deprecated as Vitest no longer uses c8 package for coverage output. It will not be updated anymore, and Vitest will fail in the next version if the user hasc8
as their coverage provider. Please, install the new@vitest/coverage-v8
package if you previously used@vitest/coverage-c8
.
- Vitest now uses v8 code coverage directly for better performance.
-
mocker: Don't restore mock to the original if the module is automocked - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3518 (c1004)
-
spy.mockRestore
on auto-mocked named exports will no longer restore their implementation to the actual function. This behavior better matches what Jest does.
-
🚀 Features
- Support ssr optimizer - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3490 (89842)
- Image type add apng - by @btea in https://github.com/vitest-dev/vitest/issues/3498 (a53c2)
-
expect: Support
expect.soft
- by @Dunqing in https://github.com/vitest-dev/vitest/issues/3507 (7c687) -
runner: Support using function/class as
describe
/test
name - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3497 (15253)
🐞 Bug Fixes
- The cli option is passed to coverage.exclude - by @btea in https://github.com/vitest-dev/vitest/issues/3506 (c37cd)
- optimizer: Always respect optimizeDeps even if include/exclude is overridden - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3488 (eb285)
- runner: Ensure Vitest is deduped - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3489 (2deb7)
- ui: Don't cache coverage assets - by @userquin in https://github.com/vitest-dev/vitest/issues/3508 (952b5)
- vite-node: Circular import stuck - by @Dunqing in https://github.com/vitest-dev/vitest/issues/3480 (50f07)
- watch: Junit reporter fails to re-generate report - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3496 (5b73c)
View changes on GitHub
v0.31.4
🚀 Features
- Enable experimentalOptimizer - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3413 (5a894)
🐞 Bug Fixes
- vite-node: Deps.inline doesn't work - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3485 (be930)
View changes on GitHub
v0.31.3
🚀 Features
- Support
VITE_NODE_DEPS_MODULE_DIRECTORIES
from .npmrc - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3471 (393bf)
🐞 Bug Fixes
- logger: Print unhandled errors before summary - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3474 (4c9a7)
- runner: Suite options do not propagate to nested suites (fix: #3467) - by @xsjcTony in https://github.com/vitest-dev/vitest/issues/3473 and https://github.com/vitest-dev/vitest/issues/3467 (9fb9d)
- vite-node: Clear importers when invalidating module - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3475 (add29)
View changes on GitHub
v0.31.2
🚀 Features
- Throw error if using inline snapshot inside of
test.each
ordescribe.each
- by @fenghan34 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3360 (7c2f7) - Pass down meta information to Node.js process - by @sheremet-va and @dammy001 in https://github.com/vitest-dev/vitest/issues/3449 (e39ad)
-
coverage: Add
reportOnFailure
option - by @AriPerkkio and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3453 (1988f) - dev: Add moduleDirectories option to the vitest config - by @fooddilsn and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3337 (b3602)
🐞 Bug Fixes
- Don't print empty diff - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3437 (32b53)
- Don't restore methods in automocked dependencies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3438 (d1afd)
- Dot reporter scrollback buffer spam - by @gtm-nayan in https://github.com/vitest-dev/vitest/issues/3415 (e6792)
- Gracefully exit when first
SIGINT
is received - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3407 (a2cc2) -
rejects
&resolves
breaks with thenable objects - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3456 (4e996) - Prevent
birpc
timeouts whenMath.random
mock is not restored - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3460 (cd5d5) - Assertion diff message now handle non writable property correctly - by @PCreations in https://github.com/vitest-dev/vitest/issues/3422 (f75ab)
- Extend logging of process timeout errors - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3452 (42643)
- Support requiring files with
less
extension - by @rluvaton in https://github.com/vitest-dev/vitest/issues/3465 (4d045) -
cli:
- Improve colors used when erroring - by @ghiscoding and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3349 (16681)
-
runner:
- Suite timeout does not take effect - by @btea in https://github.com/vitest-dev/vitest/issues/3455 (82547)
-
spy:
- Don't print received calls if there are no calls - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3405 (41e11)
-
typecheck:
- Show tsc errors not related to test files - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3441 (a1da5)
-
types:
- Fix
PartialMock
with async TReturns - by @ghry5 in https://github.com/vitest-dev/vitest/issues/3462 (b664d)
- Fix
-
vite-node:
- Circular import stuck - by @Dunqing in https://github.com/vitest-dev/vitest/issues/3418 (632ee)
- Coerce to string in import(dep) - by @jcbhmr and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3430 (b72eb)
- Don't remove sourcemap string in source code - by @rxliuli and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2918 and https://github.com/vitest-dev/vitest/issues/3379 (02dc9)
- Don't externalize "dist" by default - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3446 (306b2)
View changes on GitHub
v0.31.1
🚀 Features
-
watch: Press
r
should rerun current pattern tests - by @Dunqing and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3305 (69d27)
🐞 Bug Fixes
- Make sure thrown error is an object - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3298 (a93be)
- Remove duplicate type - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3303 (5382e)
- Throw an error, if tests are collected with a different vitest version - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3301 (708b1)
- Support application/x-gzip metadata in html report - by @mzanelee and Michael Lee in https://github.com/vitest-dev/vitest/issues/3333 (5bf7e)
- Correctly restore vi.fn implementation - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3341 (2aff8)
- Display error message correctly - by @btea in https://github.com/vitest-dev/vitest/issues/3314 (a5b3d)
- Exclude
cwd
from test name filter - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3353 (324a9) - Check error type before modifying it - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3385 (c44d9)
-
toMatchInlineSnapshot
fails when file path includes parentheses - by @pacexy in https://github.com/vitest-dev/vitest/issues/3370 and https://github.com/vitest-dev/vitest/issues/3371 (dcf13) - Stop spying on a method, when it's restored - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3386 (2cb1a)
- Test repeats - by @fenghan34 in https://github.com/vitest-dev/vitest/issues/3369 (fb8fc)
-
browser:
- Throw an error if test failed to load - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3390 (b354b)
- Keep default export when rewriting exports - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3389 (6501d)
-
cli:
- Improve cac errors when mixing boolean and dot notation - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3302 (93fbd)
-
reporter:
- Prevent deleting test reports stored in coverage directory - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3331 (ddbba)
-
typecheck:
- Correctly resolve custom tsconfig path - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3342 (c53ae)
-
vite-node:
- Allow returning id not wrapped in promise - by @danielroe in https://github.com/vitest-dev/vitest/issues/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 https://github.com/vitest-dev/vitest/issues/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 https://github.com/vitest-dev/vitest/issues/3258 (0c09a)
- Bypass ESM import order restriction with
vi.hoisted
to run code before imports are executed:
vi.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 https://github.com/vitest-dev/vitest/issues/2652 (7c8f0)
- Add an option to hide skipped test lines - by @g4rry420 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2745 (9bdb1)
- coverage: Watermarks for c8 - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3254 (730af)
- ui: Add html coverage - by @userquin and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3071 (e24cd)
-
watch: Test run cancelling, feat:
--bail
option for cancelling test run - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3163 (8d460)
🐞 Bug Fixes
- Don't call global setup teardown twice - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3188 (ba3d1)
- Reporter to log version before provider initalizations - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3131 (481b1)
- Throw an error if Vitest cannot access its internal state - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3250 (fbb14)
- Warning suppression broken - by @IceQub3 in https://github.com/vitest-dev/vitest/issues/3270 and https://github.com/vitest-dev/vitest/issues/3271 (036de)
- Show correct diff in "toHaveBeenCalledWith" - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3289 (19fcd)
- Don't print esm warning, if package name is not found - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3292 (62c14)
- Support exactOptionalPropertyTypes - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3293 (ba81d)
- Don't inline vite hmr and rollup types - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3291 (1f118)
-
browser:
- Failing to load vitest/utils - by @userquin in https://github.com/vitest-dev/vitest/issues/3190 (78bad)
-
coverage:
-
thresholdAutoUpdate
to work withperFile
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3182 (29eeb) - Throw error if fail to load built-in provider - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3217 (0a287)
- Stackblitz hangs with c8 - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3225 (d9fda)
- C8 to ignore vite's generated helpers - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3241 (21942)
- Workspaces c8 source maps - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3226 (efce3)
-
-
docs:
- Correct typo and broken link to WebdriverIO - by @nathanbabcock in https://github.com/vitest-dev/vitest/issues/3275 (c7da1)
-
spy:
- Update to set initial implementation through normal logic - by @Codex- in https://github.com/vitest-dev/vitest/issues/3260 and https://github.com/vitest-dev/vitest/issues/3263 (c759a)
-
vite-node:
- Circular imports - by @antfu in https://github.com/vitest-dev/vitest/issues/3196 (cbb59)
- Add missing
import.meta.hot.send
mock - by @antfu (b1624)
-
vitest:
- Also check for vite relative to vitest package - by @JoshuaKGoldberg and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3274 (a3393)
-
watch:
- Run test files when added to filesystem - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3189 (7b2c8)
View changes on GitHub
v0.30.1
🐞 Bug Fixes
- Do not rely on global
performance
andAggregateError
- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3171 (cce45) - Allow workspace without a config in the root - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3173 (06852)
-
test.each
respectschaiConfig
- by @sheremet-va (4f6c1) - Use relative paths in source map's "sources" field - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3177 (6b1b4)
-
types:
- Allow augmenting jest namespace for custom assertions - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3169 (905ec)
- Publish utils and snapshot .d.ts files for typescript - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3172 (7af64)
-
snapshot:
-
toMatchFileSnapshot
ensure dir exists - by @antfu in https://github.com/vitest-dev/vitest/issues/3155 (31168) - Improve
skipWriting
check - by @antfu (5436c) - Normalize EOL for
toMatchFileSnapshot
- by @antfu in https://github.com/vitest-dev/vitest/issues/3164 (df3f2)
-
View changes on GitHub
v0.30.0
🚨 Breaking Changes
- Remove tinyspy internal properties on Vitest spies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3069 (2f1dc)
- Only support Node.js 14.18.0 or newer - by @danez in https://github.com/vitest-dev/vitest/issues/2985 (287dc)
- Use "concordance" package to display diff instead of using custom diff - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2828 (44630)
- Move snapshot implementation into @vitest/snapshot - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3032 (6aff0)
- Bump coverage packages vitest peer dependency - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3126 (be1bf)
- Add workspace support - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3103 (b9d1a)
- Experimental optimizer introduced in 0.29.0 is temporarily disabled.
🚀 Features
- Gzip html reporter's metadata - by @7rulnik in https://github.com/vitest-dev/vitest/issues/3113 (7856e)
- Add chai config - by @btea in https://github.com/vitest-dev/vitest/issues/3066 (6fcba)
-
snapshot: Introduce
toMatchFileSnapshot
and auto queuing expect promise - by @antfu in https://github.com/vitest-dev/vitest/issues/3116 (bdc06)
🐞 Bug Fixes
- Resolve reporters passed down to the CLI relative to the running directory - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/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 https://github.com/vitest-dev/vitest/issues/3111 (83a9a)
- Stack trace point to incorrect file - by @ChenKS12138 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3004 and https://github.com/vitest-dev/vitest/issues/3115 (5cee4)
- Run benchmarks sequentially - by @thecodrr in https://github.com/vitest-dev/vitest/issues/2004 and https://github.com/vitest-dev/vitest/issues/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 https://github.com/vitest-dev/vitest/issues/3047 (1531c)
- Show browser console in the terminal - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3048 (ee6f5)
- Playwright as browser provider - by @Aslemammad and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3079 (9dc69)
- Implement
istanbul
coverage support for browser testing - by @sheremet-va and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3040 (0f44d)
🐞 Bug Fixes
- Add generic to expect.objectContaining type - by @ArtyMaury in https://github.com/vitest-dev/vitest/issues/3053 (69d2c)
- Do not fail, when primitive error is thrown - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3074 (6efe6)
- Handle cloning proxied classes w/ enumerable getters - by @tgriesser in https://github.com/vitest-dev/vitest/issues/3026 (196a0)
- Spy on popup apis like alert - by @Aslemammad and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3076 (280ad)
- Report coverage even when no tests found - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/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
🐞 Bug Fixes
- Bundle UI with @vitest/browser - by @sheremet-va (14091)
View changes on GitHub
v0.29.5
🐞 Bug Fixes
- browser: Relax vitest peer dependency - by @cexbrayat in https://github.com/vitest-dev/vitest/issues/3039 (865d1)
View changes on GitHub
v0.29.4
🚀 Features
-
--test-timeout
CLI argument - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3019 (63c62) - Add an option to control Vitest pool with filepath - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3029 (c7f0c)
- Process timeout to log names of stuck test files - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3031 (0ddf7)
- Support relative path in html report - by @poyoho and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2695 (a7680)
- Webdriverio (+ custom providers) integration for browser mode - by @Aslemammad, Christian Bromann, @sheremet-va, @userquin and @dammy001 in https://github.com/vitest-dev/vitest/issues/2999 (9cdc8)
🐞 Bug Fixes
- Show correct line numbers in stack trace when using vi.resetModules() - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3020 (35730)
- Mocking value proxy filter Symbol static properties - by @ChpShy in https://github.com/vitest-dev/vitest/issues/3036 (0cf44)
- Escape XML in error stack trace when using junit reporter - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/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 https://github.com/vitest-dev/vitest/issues/2982 (1fe82)
- config: Add an option to run setupFiles in sequence - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3008 (c2e25)
🐞 Bug Fixes
- Console log not visible - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2943 (02808)
- Remove duplicate execArgv when deps.registerNodeLoader: true - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2965 (a1954)
- Prevent running test cases timers after environment teardown - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2971 (bde75)
- Don't mark setupFiles as test files, if experimentaOptimizer is used - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2974 (819c6)
- Config errors not visible - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2995 (f01c7)
- --inspect to work inside workers - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2983 (36087)
-
types: Use
any
as default value for TArgs in vi.fn() - by @jessevanassen in https://github.com/vitest-dev/vitest/issues/2947 (1bdcc)
🏎 Performance
- reporters: Overall improvements - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3006 (22ca0)
View changes on GitHub
v0.29.2
🐞 Bug Fixes
- Optimize dependencies in setup files - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2935 (c169f)
- coverage: C8 provider to work when isolate:false - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2929 (86538)
View changes on GitHub
v0.29.1
🐞 Bug Fixes
- Wait for optimized dependency to be bundled in non-pnpm package managers - by @sheremet-va (d2460)
View changes on GitHub
v0.29.0
This release makes some significant changes to how tests are running. If you were using --no-threads
before, you might consider enabling --single-thread
instead (because your tests are now running in child_process
instead of a worker thread) or try our new performance optimization feature (discussed later). If you were relying on API that was not available inside a worker (like process.chdir()
, you can now use this option.
One of the potential breaking bug fixes is that environments do not share the same global scope anymore if you run them with --no-isolate
, --no-threads
or --single-thread
- you might need to update your setup files if you were relying on a global variable before.
If you had performance issues on large code bases before, try the new deps.experimentalOptimizer
option instead of disabling threads. Feedback is welcome!
One of the breaking changes includes adding a link to snapshots inside snapshot files, meaning you will need to update all your snapshots.
🚨 Breaking Changes
- Vitest as peer dependency for coverage packages - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2836 (94247)
- Coverage-c8 to use V8 profiler directly instead of
NODE_V8_COVERAGE
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2786 (095c6) - Add a link to the comment at the top of the snapshot file - by @btea in https://github.com/vitest-dev/vitest/issues/2867 (615e1)
- Always run separate environments in isolation - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2860 (1f858)
- Tests with
node
andjsdom
(and other environments) now don't share the same global scope, if you run them with--no-isolate
or--no-threads
flag. Vitest doesn't provide a way to restore the previous behavior as it is considered a bug.
- Tests with
- Use child_process when --no-threads is used - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2772 (7bf54)
- Tests inside
chid_process
might run longer due to the communication overhead. If you want to restore the previous behavior, use--single-thread
.
- Tests inside
🚀 Features
- Add test seed to banner - by @btkostner in https://github.com/vitest-dev/vitest/issues/2877 (bdb39)
- Use custom source-map-support implementation - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2905 (6ff6c)
- Add an option to enable Vite optimizer - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2912 (af8de)
-
coverage:
- Add support for coverage reporter options - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2690 (f8176)
- Automatic threshold updating - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2886 (e1652)
-
spy:
- Implement mock.withImplementation API - by @obadakhalili and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2835 (610b1)
-
vite-node:
- Cli option for vite mode - by @abarke in https://github.com/vitest-dev/vitest/issues/2893 (0fc08)
🐞 Bug Fixes
- Wait for console.log to print a message before terminating a worker - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2861 (fbc54)
- Cleanup last mocked cache when call vi.doMock - by @mysteryven in https://github.com/vitest-dev/vitest/issues/2872 (65d71)
- Reload changed configuration file on watch mode - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2889 (4d277)
- coverage: Custom providers to work inside worker threads - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2817 (81604)
View changes on GitHub
v0.28.5
🚀 Features
- Add --script option to vite-node - by @jgoux and @dammy001 in https://github.com/vitest-dev/vitest/issues/2793 (d3d6b)
- Inject executor directly into runner - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2858 (62c43)
🐞 Bug Fixes
- Don't call "afterAll" hooks, if suite was skipped - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2802 (aa1aa)
- Always display serialized error, even if it doesn't have stack - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2829 (ab5f8)
- Clear mocks between tests - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2857 (c420c)
-
expect:
- Check for no 'throw' type in toHaveReturned - by @trivikr in https://github.com/vitest-dev/vitest/issues/2850 (1164c)
- Accept array index as number in toHaveProperty - by @trivikr in https://github.com/vitest-dev/vitest/issues/2808 (8705e)
🏎 Performance
- Don't inline Vitest entry - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2819 (570c6)
View changes on GitHub
v0.28.4
🐞 Bug Fixes
- Setup correct utils inside asymmetric matchers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2768 (415c8)
- Cjs exports has Object.prototype instead of null - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2769 (4fc49)
- Duplicate callbacks in vite-node HMR - by @jgoux in https://github.com/vitest-dev/vitest/issues/2792 (f0333)
- Do not include source files in
onWatcherStart
whentypecheck.ignoreSourceErrors
is true - by @mascii and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2774 (d612e)
View changes on GitHub
v0.28.3
🚀 Features
- Allow using atomics to communicate between threads - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2758 (3679c)
- Show active filename pattern on CLI - by @AriPerkkio (a0455)
- Show active test name pattern on CLI - by @AriPerkkio (df7c4)
- Allow
config
option to be false - by @antfu in https://github.com/vitest-dev/vitest/issues/2749 (c66e3)
🐞 Bug Fixes
- Watch mode's filename pattern to persist on unrelated file changes - by @AriPerkkio (712ac)
- Watch mode's filename pattern to persist re-run of failed tests, snapshot updates and testname filter changes - by @AriPerkkio (1c65a)
- Dont incorrectly mark run failed if filename pattern excludes previously failed tests - by @AriPerkkio (61cf9)
- coverage: Istanbul crashes when no tests were run - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2753 (ebc95)
🏎 Performance
- Don't import vite in worker - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2759 (e49c1)
View changes on GitHub
v0.28.2
🐞 Bug Fixes
- Send stderr header log to stderr - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2736 (998ea)
- Call afterAll, if beforeAll failed - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2737 (1904c)
-
vite-node: Don't cache modules with
timestamp: 0
- by @danielroe in https://github.com/vitest-dev/vitest/issues/2747 (e88c0)
View changes on GitHub
v0.28.1
🐞 Bug Fixes
- Remove UI from Vitest dependencies - by @sheremet-va (b120c)
View changes on GitHub
v0.28.0
🚨 Breaking Changes
- Don't rely on environment for interopDefault - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2682 (3f20c)
- Move test runner into a separate package - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2721 (482b7)
- To extend text context, you need to augment
@vitet/runner
package instead ofvitest
- To extend text context, you need to augment
🐞 Bug Fixes
- coverage: C8 to log warning when run in Stackblitz - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2735 (b6c41)
View changes on GitHub
v0.27.3
🚀 Features
- Throw unhandled exception, if code throws "error" event - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2691 (6a30c)
- New
environmentMatchGlobs
option to auto infer env based on glob - by @antfu in https://github.com/vitest-dev/vitest/issues/2714 (3e142) - Add basic reporter which allow user to use reporter in ci - by @trim21 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2612 (5df52)
- Improve "isCI" check - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2705 (e6457)
🐞 Bug Fixes
- Show error in the terminal, if "only" flag is used - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2696 (24d63)
- Cpu and heap profiling options for workers - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2702 (c31a0)
- Show correct number of tests in test summary - by @poyoho in https://github.com/vitest-dev/vitest/issues/2703 (859e7)
- Don't terminate workers on Node 14 to not trigger fatal error - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2697 (db9b6)
- Allow custom async matchers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2707 (b5669)
- Remove setup files from coverage - by @g4rry420 in https://github.com/vitest-dev/vitest/issues/2574 (488e4)
-
reportCoverage
context can be optional - by @antfu (4cd1e) - ENOENT assets when htmldir exists - by @everett1992 in https://github.com/vitest-dev/vitest/issues/2701 (5a656)
- Correctly resolve paths relative to root, when used outside of root directory - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2687 (703aa)
- typecheck: Store tmp tsconfig close to original one - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2660 (26f91)
View changes on GitHub
v0.27.2
🚀 Features
- Add runAllTimersAsync from sinonjs - by @guillaumeduboc in https://github.com/vitest-dev/vitest/issues/2209 (40187)
🐞 Bug Fixes
- Document.defaultView references the same window as the global one - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2649 (1ac4b)
- Trim input filename and test name - by @btea in https://github.com/vitest-dev/vitest/issues/2650 (d3dcb)
- Increase default teardownTimeout - by @sheremet-va (13e53)
- Mock css files imported with "require" - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2679 (6c1a2)
- Don't start watching files in "run" mode - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2680 (0a31e)
- Rerun tests, when setup file is edited - by @mysteryven and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2625 (019a6)
- Always show filename for unhandled errors - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2689 (15aa0)
- Define property instead of assigning it in vi.stubGlobal - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2685 (8a1d7)
-
coverage: Watch mode to use
coverage.all
only when all tests are run - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2665 (85096) - typecheck: Log tests with verbose reporter, correctly show "pass" tests - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2656 (61dde)
- ui: Don't show "connecting" screen in html reporter - by @poyoho in https://github.com/vitest-dev/vitest/issues/2693 (d8548)
🏎 Performance
- Don't resolve import path, if it was already resolved - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2659 (45cc3)
View changes on GitHub
v0.27.1
🚀 Features
- Show error, when process.exit is called - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2643 (866f4)
- Add more information about unhandler error - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2642 (1ffb0)
- Display running processes, if vitest closes with timeout - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2633 (94968)
🐞 Bug Fixes
- Type issue with spyOn method - by @samkevin1 in https://github.com/vitest-dev/vitest/issues/2365 and https://github.com/vitest-dev/vitest/issues/2582 (1aaa7)
- Add missing types in TS project when global is true - by @Sneaken in https://github.com/vitest-dev/vitest/issues/2631 (4745e)
- Always report failed test in junit reporter - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2632 (83da2)
- Change Vite root, if test.root is used - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2637 (efbff)
- Don't use ownKeys, when interoping a module - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2629 (a186a)
- Cut duplicate error in negated toHaveBeenCalled - by @richardboehme in https://github.com/vitest-dev/vitest/issues/2638 (09d62)
- Always update last HMR ms on a module - by @sheremet-va (99676)
- Terminate workers, when closing process - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2645 (ece43)
-
coverage:
- Prevent c8 from crashing on invalid sourcemaps - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2634 (0163d)
- Istanbul provider to use
coverage.extension
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2641 (7e388)
View changes on GitHub
v0.27.0
🚨 Breaking Changes
- Deprecate "error" on result, store errors in "errors" - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2586 (e641a)
- Split vitest into separate packages, but still bundle them for the time being - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2575 (c8e6f)
🚀 Features
- coverage: report only changed files when using istanbul coverage with watch mode - by @g4rry420 in https://github.com/vitest-dev/vitest/issues/2385 (bf872)
🐞 Bug Fixes
- Return mock path only when mocked - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2619 (f8ac2)
- Allow mocking CJS module with interoped default - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2598 (6b3e3)
- Avoid random ENOTEMPTY errors - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2620 (59766)
- Always inline assets and modules with special Vite queries - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2617 (fed1c)
-
cli:
- Allow overrides reporter via cli option - by @mysteryven and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2573 (894f1)
-
coverage:
- Flaky c8 coverage caused by parallel sourcemap constructing - by @AriPerkkio and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2591 (9a29f)
- Validate extension, when reporting c8 coverage - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2626 (74463)
🏎 Performance
- Improve vi.mock performance - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2594 (09d19)
View changes on GitHub
v0.26.3
🚀 Features
-
mock: Expose a
importOriginal
helper to the factory - by @antfu in https://github.com/vitest-dev/vitest/issues/2551 (853ee)
🐞 Bug Fixes
- Correctly automock nested interoped defaults - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2559 (a431d)
- Start tracking module resolution as soon as possible for easier tracking - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2560 (9f41e)
- Don't hang when mocking module with circular dependency - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2572 (c479d)
- Show list of tests when typechecking - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2585 (32a57)
- api: Make api parse error stacks and return sourcePos in onTaskUpdate - by @adrienbaron in https://github.com/vitest-dev/vitest/issues/2563 (ef77d)
- coverage: Env-replacer to remove query params from sourcemaps filenames - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2584 (dba13)
View changes on GitHub
v0.26.2
🚀 Features
🐞 Bug Fixes
- Improve "isInternaRequest" check - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2541 (2bb9a)
- Use correct word when printing "long-running" warning - by @simon-abbott in https://github.com/vitest-dev/vitest/issues/2546 (8dc1c)
- Pass down diff options - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2545 (98c94)
-
cli: Respect inline config
dir
- by @antfu in https://github.com/vitest-dev/vitest/issues/2550 (f6b59)
View changes on GitHub
v0.26.0
🚨 Breaking Changes
- vite-node: Rewrite how vite-node resolves id - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2463 (58ee8)
- Correctly interop nested default for external and inlined modules - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2512 (084e9)
- If your environment is
node
, Vitest will not resolve invalid named exports (exports that are on "default" property will not magically appear as named exports), unlessdeps.interopDefault
is enabled, or dependency is indeps.inline
. This change doesn't affectjsdom
,happy-dom
oredge
environments.
- If your environment is
-
web-worker: Make web-worker implementation more compatible with spec - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2431 (c3a63)
- Messages are now cloned with
structuredClone
, if it's available, or fallbacks to a polyfill. - Added support for
SharedWorker
- Messages are now cloned with
🚀 Features
- Introduce a native way to set env and globals - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2515 (b114d)
- Add html reporter based on Vitest UI - by @poyoho and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2444 (b8f34)
- If you have
@vitest/ui
installed, you can now use'html'
reporter to get a beautiful UI to view your test results, inspect module graph and read log messages.
- If you have
🐞 Bug Fixes
- Allow assigning new hotContext - by @cometkim in https://github.com/vitest-dev/vitest/issues/2524 (b4c43)
View changes on GitHub
v0.25.8
🚀 Features
- Add mts, cts files to coverage - by @poyoho and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2492 (799f9)
🐞 Bug Fixes
- Don't throw unhandled error, if import was caught - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2494 (0a87e)
- coverage: Esbuild to preserve legal comments for ignore hints - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2496 (c85ed)
View changes on GitHub
v0.25.7
🚀 Features
- Support Vite 4 - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2470 (3bb6b)
🐞 Bug Fixes
- Restart on config change crashes - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2481 (286e9)
- coverage-istanbul: Clear coverage map after use - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2466 (e6a18)
View changes on GitHub
v0.25.6
🐞 Bug Fixes
- Expected reversed with actual - by @poyoho in https://github.com/vitest-dev/vitest/issues/2460 (f02c9)
- Try to resolve id, if relative path is provided - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2461 (e9cb4)
View changes on GitHub
v0.25.5
🚀 Features
- ui: Show diff in report panel - by @scarf005 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2406 and https://github.com/vitest-dev/vitest/issues/2423 (8595c)
🐞 Bug Fixes
- Correctly resolve filename, when running code - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2439 (2e789)
- Move sourcemapping source out of the sourcemap - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2443 (cc13c)
View changes on GitHub
v0.25.4
🚀 Features
- Slow test threshold - by @poyoho and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2396 (98974)
- Format test tablename - by @poyoho in https://github.com/vitest-dev/vitest/issues/2405 (45c5c)
- Suspend process - by @poyoho in https://github.com/vitest-dev/vitest/issues/2422 (b8ee8)
- Format test objects in
each
title - by @scarf005 in https://github.com/vitest-dev/vitest/issues/2420 and https://github.com/vitest-dev/vitest/issues/2421 (1868f)
🐞 Bug Fixes
- Exit with code 1, when type tests fail - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2378 (98141)
- Tab affect vi.mock - by @poyoho in https://github.com/vitest-dev/vitest/issues/2402 (5a3de)
- Don't escape "\" in diff view - by @poyoho in https://github.com/vitest-dev/vitest/issues/2430 (7d4e3)
- Correct test files status in json reporter - by @brzezinskimarcin in https://github.com/vitest-dev/vitest/issues/2417 and https://github.com/vitest-dev/vitest/issues/2419 (ce931)
- Export all named CJS exports, if default export is a function - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2435 (d43f3)
- Add test attributes to "testsuites" in junit reporter - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2362 (d0506)
- DynamicImportSettled also waits for nested imports - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2389 (5098b)
- Always apply vite ssr source maps - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2433 (cbf91)
- Copy-pasting from module graph browser - by @g4rry420 in https://github.com/vitest-dev/vitest/issues/2321 (8920a)
- deps: Update dependency strip-literal to v1 - by @renovate[bot] in https://github.com/vitest-dev/vitest/issues/2387 (824e1)
- mocker: Set cache before mocking to allow circular dependencies - by @danez in https://github.com/vitest-dev/vitest/issues/2391 (fd829)
View changes on GitHub
v0.25.3
🚀 Features
- Test.each support string template - by @poyoho in https://github.com/vitest-dev/vitest/issues/2337 (f7897)
🐞 Bug Fixes
- Junit consistently puts "skipped" inside "testcase" - by @sheremet-va (f7b27)
- Detect tests in folders starting with
.
- by @sidharthv96 in https://github.com/vitest-dev/vitest/issues/2344 and https://github.com/vitest-dev/vitest/issues/2359 (c3951) - cli: Don't override config by setting cli options to undefined - by @rmehner in https://github.com/vitest-dev/vitest/issues/2330 (6ce3e)
- coverage: Env-replacer to add filenames into sourcemaps - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2338 (a2e9d)
- mocker: Clear automocked modules on unmock - by @mcous in https://github.com/vitest-dev/vitest/issues/2353 (60918)
View changes on GitHub
v0.25.2
🐞 Bug Fixes
- Dates are equal, if both are invalid - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2326
- Don't ignore properties, when put on a default function in CJS context - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2325
View changes on GitHub
v0.25.1
🚀 Features
- Add
vi.setConfig
helper - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2293 - Allow hooks to be executed in a stack or list - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2294
🐞 Bug Fixes
- Always rewrite defined jsdom keys - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2290
- Default reporter regression - by @antfu in https://github.com/vitest-dev/vitest/issues/2292
- Don't fail
bench
when using options - by @poyoho in https://github.com/vitest-dev/vitest/issues/2295
View changes on GitHub
v0.25.0
✅ Builtin TypeChecking
In v0.25.0, Vitest allows you to write tests for your types, using expectTypeOf
or assertType
syntaxes. By default all tests inside *.test-d.ts
files are considered type tests. Run vitest typecheck
to run type tests.
// my.test-d.ts
import { assertType, expectTypeOf } from 'vitest'
import { mount } from './mount.js'
test('my types work properly', () => {
expectTypeOf(mount).toBeFunction()
expectTypeOf(mount).parameter(0).toMatchTypeOf<{ name: string }>()
// @​ts-expect-error name is a string
assertType(mount({ name: 42 }))
})
Learn more at the documentation and this RFC
🚨 Breaking Changes
- Return context in
startVitest()
- by @antfu in https://github.com/vitest-dev/vitest/issues/2072
🚀 Features
-
onTestFailed
hook - by @antfu in https://github.com/vitest-dev/vitest/issues/2210 - Display error frame if present (like Vite) - by @haikyuu and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2257
- Benchmark table report - by @poyoho in https://github.com/vitest-dev/vitest/issues/2179
- Add typechecking functionality - by @sheremet-va and @antfu in https://github.com/vitest-dev/vitest/issues/2107
🐞 Bug Fixes
- Clear full screen only in watch mode - by @sheremet-va (c3d89)
- Don't serialize symbols and immutables - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2266
- Use --conditions instead of -C - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2267
- Show correct stack trace in errors and console - by @sheremet-va and @antfu in https://github.com/vitest-dev/vitest/issues/2248
- Align
.each
behavior with jest - by @bartoszgolebiowski and @antfu in https://github.com/vitest-dev/vitest/issues/2064 - Remove undefined values in options - by @g4rry420 and @antfu in https://github.com/vitest-dev/vitest/issues/2281
- coverage: Istanbul provider to preserve implicit else - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2275
View changes on GitHub
v0.24.5
🚀 Features
- vite-node: Trigger beforeFullReload / beforePrune / invalidate hook - by @ycmjason in https://github.com/vitest-dev/vitest/issues/2079
🐞 Bug Fixes
- Respect folders with dot at the start, when mocking - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2244
- Prevent using mocks in rpc - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2254
- Show actual unhandled errors, serialize DOMErrors - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2253
- Load deps reporter - by @poyoho in https://github.com/vitest-dev/vitest/issues/2249
View changes on GitHub
v0.24.4
🚀 Features
- vite-node: Don't exit on uncaughtException in watch mode - by @poyoho in https://github.com/vitest-dev/vitest/issues/2186
🐞 Bug Fixes
- Add/Update
repository
properties inpackage.json
- by @silverwind in https://github.com/vitest-dev/vitest/issues/2151 - Ignore benchmark.reporters in getSerializableConfig - by @kainstar in https://github.com/vitest-dev/vitest/issues/2164
- Improve config's default exclude - by @haikyuu and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2188
- Always use node condition - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1919
- Clear terminal output before running tests, show errors in correct order - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2228
- Improve compatibility with native Node CJS resolution - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2226
- Don't use resolved paths if they don't actually exist - by @simon-abbott in https://github.com/vitest-dev/vitest/issues/1868
-
cli:
- Set inputNamePattern to RegExp source instead of string - by @rafedramzi in https://github.com/vitest-dev/vitest/issues/2201
- Normalize argument path - by @poyoho in https://github.com/vitest-dev/vitest/issues/2180
-
coverage:
- Trim URL parameters from file paths in istanbul coverage - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2232
- Trim URL parameters from file paths in c8 coverage - by @OrestHk and @sheremet-va in https://github.com/vitest-dev/vitest/issues/2181
-
reporter:
- Load custom reporter using
executeFile
- by @poyoho in https://github.com/vitest-dev/vitest/issues/2184
- Load custom reporter using
-
vitest:
- Return detailed error when using toHaveReturnedWith - by @azaleta in https://github.com/vitest-dev/vitest/issues/2163
View changes on GitHub
v0.24.3
🐞 Bug Fixes
- build: Build packages before publishing - by @sheremet-va (3c4a2)
View changes on GitHub
v0.24.2
🚀 Features
- ui: Add tests summary in the dashboard - by @webfansplz and @userquin in https://github.com/vitest-dev/vitest/issues/2133
🐞 Bug Fixes
- bench: Throw root cause - by @azaleta and @nickmccurdy in https://github.com/vitest-dev/vitest/issues/2137
- browser: Working again - by @userquin in https://github.com/vitest-dev/vitest/issues/2143
- coverage: Reduce size of leftover v8 reports - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2144
- vite-node: Init the debugger ahead of time to ensure that load dumped code work as expected (fix #2126) - by @await-ovo in https://github.com/vitest-dev/vitest/issues/2127
View changes on GitHub
v0.24.1
🐞 Bug Fixes
- Remove work-around from
istanbul-lib-instrument
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2121 - Don't show extra properties for test context - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2116
- Parse env options from comments (fix #1962) - by @nickmccurdy in https://github.com/vitest-dev/vitest/issues/1984
- coverage: Fix sourcemaps of uncovered lines - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2122
View changes on GitHub
v0.24.0
🚨 Breaking Changes
- Use type module (revert #1411) - by @bluwy and @sheremet-va in https://github.com/vitest-dev/vitest/issues/1465
- Drop support for Vite 2 - by @antfu and @sheremet-va in https://github.com/vitest-dev/vitest/issues/1928
🚀 Features
- benchmark: Todo mode - by @Aslemammad in https://github.com/vitest-dev/vitest/issues/2057
- inline-snapshot: Support comment - by @azaleta in https://github.com/vitest-dev/vitest/issues/2077
🐞 Bug Fixes
- Run related test, even if test doesn't have dependencies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2043
- Check for asymmetricMatch before accessing - by @sheremet-va (75719)
- Check hook teardown return type, closes #2092 - by @sheremet-va (cba3f)
- Don't stop watch mode, if non-object error is thrown, close #2106 - by @sheremet-va (bd677)
- Use correct source maps in stacktrace - by @haikyuu in https://github.com/vitest-dev/vitest/issues/2027
- Import CustomEventMap from vite for vite-node - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2124
- jsdom: Use jsdom Blob instead of Node, if jsdom is enabled - by @ChpShy in https://github.com/vitest-dev/vitest/issues/2086
View changes on GitHub
v0.23.4
🚀 Features
- Give helpful message, when using vi.mock - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2047
- benchmark: Only mode - by @Aslemammad in https://github.com/vitest-dev/vitest/issues/2039
🐞 Bug Fixes
- Move outputFile to benchmark, allow --reporter for benchmark - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/2037
- cli: Forward node wasm flags - by @Peeterush in https://github.com/vitest-dev/vitest/issues/2041
-
coverage:
istanbul-reports
to supportprojectRoot
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/2051
View changes on GitHub
v0.23.2
🚀 Features
- Added fastify example - by @irvile in https://github.com/vitest-dev/vitest/issues/1991
- bench: Improve summary - by @antfu (d0167)
🐞 Bug Fixes
- Update tinybench to 2.1.5 - by @Aslemammad in https://github.com/vitest-dev/vitest/issues/1990
-
bench:
- Rank sorting, fix #2006 - by @nickmccurdy in https://github.com/vitest-dev/vitest/issues/2007
- Do not group benchmarks - by @Aslemammad and @antfu in https://github.com/vitest-dev/vitest/issues/2016
View changes on GitHub
v0.23.1
🐞 Bug Fixes
- Show diff for errors that contain actual/expected without showDiff - by @IgnusG in https://github.com/vitest-dev/vitest/issues/1966
- Don't fail on running vitest dev (closes #1971) - by @sheremet-va (3807c)
- Don't hang when running vitest - by @sheremet-va (f3025)
- Define default exports properties as named exports for ESM compatibility - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1979
- Correctly normalize mocked path, if file is named like the folder - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1973
- ui: Display correct line and column for web UI - by @bartoszgolebiowski in https://github.com/vitest-dev/vitest/issues/1972
View changes on GitHub
v0.23.0
🚨 Breaking Changes
- Don't reset modules with --no-isolate - by @sheremet-va and @poyoho in https://github.com/vitest-dev/vitest/issues/1754
- If not processed, CSS Modules return a proxy, scope class names by filename - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1803
- Improve interchangeability with cjs - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1944
- Allow custom environments - by @sheremet-va and @Demivan in https://github.com/vitest-dev/vitest/issues/1963
🚀 Features
- Add include option in istanbul coverage - by @warmthdawn in https://github.com/vitest-dev/vitest/issues/1883
- Introduce
retry
option for tests - by @antfu in https://github.com/vitest-dev/vitest/issues/1929 - Add benchmark support with
vitest bench
command - by @poyoho in https://github.com/vitest-dev/vitest/issues/1029 - coverage: Include json reporter by default - by @poyoho (faed4)
- coverage-istanbul: Add "all" option - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/1880
- worker: Always apply custom resolver conditions - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1934
🐞 Bug Fixes
- Allow referring to first seen value while automocking - by @simon-abbott in https://github.com/vitest-dev/vitest/issues/1879
- Console.Console is undefined (close: #1877) - by @ahaoboy in https://github.com/vitest-dev/vitest/issues/1878
- Invalidate new worker and its dependencies - by @sun0day in https://github.com/vitest-dev/vitest/issues/1896
- Improve error serialization - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1921
- Clean coverage-c8 tmp before reporting (fix #1917) - by @sun0day in https://github.com/vitest-dev/vitest/issues/1925
- Automock getters and setters - by @simon-abbott and @sheremet-va in https://github.com/vitest-dev/vitest/issues/1903
- Add possibility to filter test files by fileName - by @bartoszgolebiowski and @sheremet-va in https://github.com/vitest-dev/vitest/issues/1915
- Make globalThis more compatible with jest - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1956
- Delete mock in moduleCache when unmock - by @ChpShy in https://github.com/vitest-dev/vitest/issues/1947
- Matcher toHaveProperty actually tests value - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/1958
- env-replacer: Don't modify string literals - by @tony19 in https://github.com/vitest-dev/vitest/issues/1943
- istanbul: Disable compact in instrumenter transform - by @poyoho (80739)
- reporter: Correct error source position in json report - by @azaleta and @poyoho in https://github.com/vitest-dev/vitest/issues/1909
- reporter-junit: Escape XML when in error message (fix: #1823) - by @ChrisTowles in https://github.com/vitest-dev/vitest/issues/1890
View changes on GitHub
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.