chore(deps): update vitest monorepo to v0.34.6
This MR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| @vitest/coverage-istanbul (source) | 0.28.5 -> 0.34.6 |
||
| vitest (source) | 0.29.2 -> 0.34.6 |
Release Notes
vitest-dev/vitest (@vitest/coverage-istanbul)
v0.34.6
🐞 Bug Fixes
- Overwrite global URL with environment's - by @sheremet-va in #4164 (cbe13)
- Correctly resolve external dependencies loaded by custom environments - by @sheremet-va in #4196 (e3408)
-
runner: The fixture of
test.extendshould be init once time in all test - by @Dunqing in #4168 (730b2)
View changes on GitHub
v0.34.5
🚀 Features
-
config:
- Add
diffoption - by @fenghan34 and @sheremet-va in #4063 (b50cf)
- Add
-
coverage:
- Add
coverage['100']to istanbul provider - by @marcelobotega in #4109 (a7e09)
- Add
-
vitest:
- Support
vi.waitFormethod - by @Dunqing and @sheremet-va in #4113 (d79cb) - Allow using unprocessed environment files - by @sheremet-va in #4098 (1aee1)
- Support
vi.waitUntilmethod - by @Dunqing and @sheremet-va in #4129 (e0ac9)
- Support
🐞 Bug Fixes
- Update HappyDOMOptions to be compatible with v12 - by @anthonyblond in #4135 (e8797)
- Print value shape when .resolves and .rejects fails - by @sheremet-va in #4137 (e649d)
-
docs:
- Fix lint errors on onConsoleLog example - by @marcelobotega in #4116 (ba1e7)
- expect:
-
happy-dom:
- Catch errors in happy-dom - by @capricorn86 in #4140 (c21c0)
- runner:
-
snapshot:
- Support mix of normal/with placeholders snapshots - by @RobertPechaCZ in #4118 (01e01)
-
ui:
- Correctly render ansi diff - by @so1ve and @sheremet-va in #3810 (8c315)
-
vite-node:
- Export
SourceMapInputto fix CYCLIC_CROSS_CHUNK_REEXPORT - by @Dunqing in #4128 (ca70a) - Align vite dependency version with vitest - by @sheremet-va (90ff8)
- Export
-
vitest:
- Rerun tests if a file loaded with query changes - by @sheremet-va in #4130 (a084c)
- Inject "define" in workspaces - by @sheremet-va in #4096 (b4d5a)
🏎️ Performance
- Use lazy require in vm pool - by @sheremet-va in #4136 (21ba4)
View changes on GitHub
v0.34.4
🐞 Bug Fixes
- Resolving dep optimizer issues with workspace - by @thebanjomatic in #4036 (0c13c)
- Don't process config file twice - by @sheremet-va in #4077 (a84a8)
-
coverage:
- Log info only when terminal reporter is used - by @AriPerkkio in #4027 (9f043)
-
happy-dom:
- Use the nodejs console in happy-dom v11 - by @capricorn86 in #4090 (59434)
- runner:
-
vite-node:
- Check more precisely for root/base paths - by @danielroe in #4049 (80741)
-
vitest:
- "vi" doesn't rely on context - by @sheremet-va in #4031 (0d0f3)
- Only override ssr.optimizer instead of the whole ssr object - by @sheremet-va in #4080 (410bc)
- Don't start the server when optimizer is enabled - by @sheremet-va in #4095 (00e81)
- Set SSR env only when transformMode is ssr - by @sheremet-va in #4083 (f8ea7)
- Show error when calling API on files that user has no access to - by @sheremet-va in #4085 (8b39c)
-
web-worker:
- Don't rely on browser API when it's not provided - by @sheremet-va in #4014 (e78a4)
View changes on GitHub
v0.34.3
🚀 Features
-
coverage: Add
allowExternaloption - by @vojvodics and @AriPerkkio in #3894 (c03fa) -
vitest: Export all reporters in
vitest/reporters- by @Dunqing and @sheremet-va in #3980 (5704b)
🐞 Bug Fixes
- Should remove mockPath from callstack whether success or failed - by @miserylee and lijifei in #3971 (5eb85)
- Add workspace config files to default coverage excludes - by @FelixGraf and @AriPerkkio in #3973 (20263)
- Report file error as a on JUnit - by @3c1u in #3997 (00c43)
- jsdom: Correctly resolve buffer on typed arrays - by @sheremet-va in #3998 (b42cf)
- ui: Use web hash history in ui - by @segevfiner and @sheremet-va in #3481 and #3487 (8caab)
- vite-node: Inline HMR types - by @sheremet-va in #3993 (dff60)
- vitest: Correctly resolve optimizer status - by @sheremet-va in #3992 (74dc5)
View changes on GitHub
v0.34.2
🚀 Features
- Allow importing CSS and assets inside external dependencies when using
--experimental-vm-threads- by @sheremet-va in #3880 (f4e6e) -
vitest: Allow calling
ctx.skip()inside the running test - by @sheremet-va in #3966 (5c88d)
🐞 Bug Fixes
- Don't bundle utils' source-map entry - by @sheremet-va in #3865 (a08e5)
- Reduce the memory consumption when running --experimental-vm-threads - by @sheremet-va in #3872 (d1a08)
- Indicator position of error message - by @fenghan34 in #3855 (3e1e7)
- Don't crash when using --experimental-vm-threads, interop CJS default inside node_modules - by @sheremet-va in #3876 (0c53e)
- Don't crash if total memory is not supported - by @sheremet-va in #3879 (7d1f8)
- Check memory and limit value - by @sheremet-va (f8dfb)
- Update module warning as it is moved into server config - by @jellyfishgh in #3931 (3a3eb)
- Define process variable and using import.meta.env together did not work - by @Dunqing in #3944 (e73ca)
- Correctly resolve config in a workspace - by @sheremet-va in #3947 (1c08d)
- Don't crash when calling useFakeTimers in VM pool - by @sheremet-va in #3958 (91fe4)
- Restrict access to file system via API - by @sheremet-va in #3956 (bcb41)
- Typo of mocks plugin name - by @antfu (3073b)
- Build not generated
execute.d.ts- by @btea in #3970 (0f8e6) -
css:
- Don't mock css-module if
?inlinequery is specified - by @thebanjomatic and Adam Hines in #3952 (3891d)
- Don't mock css-module if
-
expect:
- Correctly show async matcher diff - by @sheremet-va in #3960 (9423b)
-
snapshots:
- Update inline snapshot correctly - by @fenghan34 in #3887 (7b740)
- ui:
-
vitest:
- Use esm module resolution to resolve env - by @danielroe in #3951 (edb32)
- Allow rewriting process.env.NODE_MODE when using web transform mode - by @sheremet-va in #3957 (eca4b)
- Only consider cwd when using glob - by @g-plane in #3802 and #3949 (15b4f)
- Pass environmentOptions to happy-dom integration - by @sheremet-va and Raul de Melo in #3972 (6a0cb)
-
web:
- Correctly resolve assets in new URL - by @sheremet-va in #3950 (a428f)
🏎️ Performance
- dot-renderer: Speed up getTests - by @gtm-nayan in #3923 (e9404)
View changes on GitHub
v0.34.1
🐞 Bug Fixes
- Pass
--experimental-vm-worker-memory-limittotinypool- by @AriPerkkio in #3856 (3c67a)
View changes on GitHub
v0.34.0
🚨 Breaking Changes
- Transform mode affects only test files, not regular files - by @sheremet-va in #3491 (9608b)
-
transformModeis now moved toserver.transformMode. This option is highly discouraged to use. If you need to change the transform mode, use the new optiontestTransformModeinstead to control the mode based on the running test, not the current file path. By default, tests withjsdomorhappy-domusewebtransform mode, and tests usingnodeoredgeenvironment usessrmode. If you have a custom environment, it should providetransformModeproperty.
-
- Custom environment now should be processed before Vitest can consume it. It means that you cannot specify a path to a TS file or use import paths that should be processed by Vite.
- Disable
coverage.reportOnFailureby default - by @AriPerkkio in #3615 (0c6f6) - Remove
@vitest/coverage-c8package - by @AriPerkkio in #3614 (a90d6)-
@vitest/coverage-c8is no longer supported. Please, use@vitest/coverage-v8instead.
-
- Support running tests using VM context - by @sheremet-va and @dammy001 in #3203 (b0929)
- To address speed issues in some applications, Vitest now provides
experimentalVmThreadspool to run your tests using VM Sandboxes environment. Make sure you understand all pitfalls of this pool before opening an issue.
- To address speed issues in some applications, Vitest now provides
- Introduce
serveroption - by @fenghan34 and @sheremet-va in #3725 (dc4fa)- Most of
deps.options are now moved toserver.depswith a deprecation warning. Please, consider usingdeps.optimizerinstead ofdeps.inline/deps.external. Ideally, we would like to move away from usingserver.deps.inlinealtogether.
- Most of
-
vite-node: Make CLI arguments parsing behavior consistent with node/tsx/ts-node - by @rxliuli in #3574 (1cd4e)
- You now have to provide CLI arguments before the entry point. For example, instead of
vite-node index.ts --watch, you now have to dovite-node --watch index.ts.
- You now have to provide CLI arguments before the entry point. For example, instead of
- Add preact example, remove optimizer experimental status, enable by default - by @sheremet-va and @eryue0220 in #3854 (4b946)
-
deps.optimizeris now enabled by default. This means that Vitest will bundle specified dependencies before running your tests. This field inherits options fromoptimizeDepsandssr.optimizeDepswhich are populated by other plugins (like, Svelte).
-
🚀 Features
- Support
describe.sequential- by @fenghan34 and @dammy001 in #3771 (86934) - Support config junit reporter className with env - by @InfiniteXyy in #3808 (e8bc4)
- Running vitest with
--related --watchreruns non-affected tests if they were changed during a run - by @sheremet-va in #3844 (c9aea)
🐞 Bug Fixes
- Isolate workers between envs and workspaces - by @AriPerkkio (ed4e0)
- Modify condition - by @btea (a78e6)
- Module Graph view is blocking the Console view - by @g4rry420 (3b5f9)
- Port the latest
defineConfigtype from vite - by @sodatea in #3804 (9c8e3) - Don't overwrite Node.js URL global - by @sheremet-va in #3828 (cdab4)
- ForceRerunTriggers correctly triggers a rerun - by @sheremet-va in #3829 (17988)
- browser:
- core:
-
coverage:
- V8 provider to pick source maps without url query params - by @AriPerkkio in #3784 (280e6)
- Update
istanbul-lib-instrumentto v6 to fix vulnerable dependency - by @AriPerkkio in #3814 (f3bd9) - Exclude vite virtual modules by default - by @AriPerkkio in #3794 (3c851)
- node:
-
vite-node:
- Always treat node_modules as modulesDirectory - by @sheremet-va in #3830 (51ab8)
- Normalize drive letter to keep the same reference to a module - by @sheremet-va in #3836 (45521)
- Correctly resolve hmr filepath - by @sheremet-va in #3834 (711a6)
-
watch:
- Clear screen on all terminals - by @AriPerkkio in #3661 (8bd26)
🏎️ Performance
- Deprecate deps.registerNodeLoader - by @sheremet-va (7f45b)
- This option was introduced to support aliasing inside external packages. Please, use
deps.optimizer.webinstead. If you test Node.js applications, consider adding external packages toserver.deps.inline.
- This option was introduced to support aliasing inside external packages. Please, use
View changes on GitHub
v0.33.0
🚨 Breaking Changes
- Revert default include patterns - by @so1ve #3729
-
0.32.0changed the defaultincludeglobs 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 #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
concurrentoption tosequenceconfig - by @fenghan34 and @sheremet-va in #3604 (f427f) - Introduce global configuration for retry setting - by @imentu and @sheremet-va in #3598 and #3603 (9a117)
- Don't rely on util package in @vitest/utils - by @sheremet-va in #3685 (f91da)
- Support accessing other fixtures in fixture function - by @fenghan34 in #3651 (1621c)
- Support use function/class as
benchname - by @fenghan34 in #3711 (a749a) - reporters: Show full test suite when testing 1 spec file at a time - by @Dunqing in #3543 (7531c)
-
runner: Support
test.extend- by @fenghan34 in #3554 (2db1a)
🐞 Bug Fixes
- Remove "concordance" from dependencies list - by @sheremet-va in #3597 (969dc)
- Show diff correctly - by @sheremet-va in #3620 (73dd4)
- Util import - by @fubhy in #3621 (2fb4c)
- Compat with frozen Math - by @turadg in #3527 (0db67)
-
CTRL+Cto terminate run - by @AriPerkkio in #3642 (fa663) - Run mode stuck in TTY terminals - by @AriPerkkio in #3690 (141a8)
- Use first stack frame in json reporter - by @tim-smart in #3645 (80ea7)
- Print actual number for
toBeCalledTimes- by @antfu in #3696 (d3640) -
benchmark:
- Don't fail when running correct benchmarks - by @sheremet-va in #3629 (edad9)
-
browser:
- Correctly print diff - by @sheremet-va in #3627 (d756e)
- Esm injector doesn't replace class expressions - by @sheremet-va in #3641 (5c0ac)
- Transform superclass identifier - by @sheremet-va in #3681 (a1e04)
-
coverage:
-
v8to prevent crash on dynamic CJS files - by @AriPerkkio in #3657 (40f18)
-
- runner:
-
utils:
- Respect all flags in format function - by @sheremet-va in #3695 (91e16)
-
watch:
- Cancel using
hkey - by @AriPerkkio in #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
registerConsoleShortcutsfromvitest/node- by @deot in #3563 (bc49b) -
expect: Support
expect.unreachable- by @fenghan34 and @sheremet-va in #3556 (8e385) -
runner:
describe/testname support anonymous function - by @btea in #3562 (3d436)
🐞 Bug Fixes
- Avoid call stack recursion with large error (fix: #3060) - by @nathanmmiller and @sheremet-va in #3078 and #3060 (02196)
- Automatically remove define related configuration - by @btea in #3552 (368b8)
- Import
performancefromperf_hooks- by @Max10240 and wangbaolong.wbl in #3578 and #3579 (24ec8) - Revert concordance diff, use jest's diff output - by @sheremet-va in #3582 (9c7ea)
- Typo in config suggestion - by @Krisell in #3583 (68985)
-
browser:
- Change optimized deps to use
vitest- by @userquin in #3580 (b4ac8) - Access vi_inject only if it was injected - by @sheremet-va in #3587 (d9e14)
- Change optimized deps to use
-
mocker:
- Respect namespace import when hoisting vi.mock - by @sheremet-va in #3547 (158c4)
-
ui:
- Navigate to dashboard when re-running tests from coverage page - by @userquin in #3529 (bc283)
- vite-node:
View changes on GitHub
v0.32.0
🚨 Breaking Changes
- Throw an error, if the module cannot be resolved - by @sheremet-va in #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 #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.jsto be a test file. Also any file in__tests__is now considered to be a test, not just files withtestorspecsuffix.
- 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-v8package - by @AriPerkkio in #3339 (82112)- Vitest now uses v8 code coverage directly for better performance.
@vitest/coverage-c8is 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 hasc8as their coverage provider. Please, install the new@vitest/coverage-v8package 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 #3518 (c1004)
-
spy.mockRestoreon 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 #3490 (89842)
- Image type add apng - by @btea in #3498 (a53c2)
-
expect: Support
expect.soft- by @Dunqing in #3507 (7c687) -
runner: Support using function/class as
describe/testname - by @fenghan34 in #3497 (15253)
🐞 Bug Fixes
- The cli option is passed to coverage.exclude - by @btea in #3506 (c37cd)
- optimizer: Always respect optimizeDeps even if include/exclude is overridden - by @sheremet-va in #3488 (eb285)
- runner: Ensure Vitest is deduped - by @sheremet-va in #3489 (2deb7)
- ui: Don't cache coverage assets - by @userquin in #3508 (952b5)
- vite-node: Circular import stuck - by @Dunqing in #3480 (50f07)
- watch: Junit reporter fails to re-generate report - by @AriPerkkio in #3496 (5b73c)
View changes on GitHub
v0.31.4
🚀 Features
- Enable experimentalOptimizer - by @sheremet-va in #3413 (5a894)
🐞 Bug Fixes
- vite-node: Deps.inline doesn't work - by @sheremet-va in #3485 (be930)
View changes on GitHub
v0.31.3
🚀 Features
- Support
VITE_NODE_DEPS_MODULE_DIRECTORIESfrom .npmrc - by @AriPerkkio in #3471 (393bf)
🐞 Bug Fixes
- logger: Print unhandled errors before summary - by @sheremet-va in #3474 (4c9a7)
- runner: Suite options do not propagate to nested suites (fix: #3467) - by @xsjcTony in #3473 and #3467 (9fb9d)
- vite-node: Clear importers when invalidating module - by @sheremet-va in #3475 (add29)
View changes on GitHub
v0.31.2
🚀 Features
- Throw error if using inline snapshot inside of
test.eachordescribe.each- by @fenghan34 and @sheremet-va in #3360 (7c2f7) - Pass down meta information to Node.js process - by @sheremet-va and @dammy001 in #3449 (e39ad)
-
coverage: Add
reportOnFailureoption - by @AriPerkkio and @sheremet-va in #3453 (1988f) - dev: Add moduleDirectories option to the vitest config - by @fooddilsn and @sheremet-va in #3337 (b3602)
🐞 Bug Fixes
- Don't print empty diff - by @sheremet-va in #3437 (32b53)
- Don't restore methods in automocked dependencies - by @sheremet-va in #3438 (d1afd)
- Dot reporter scrollback buffer spam - by @gtm-nayan in #3415 (e6792)
- Gracefully exit when first
SIGINTis received - by @AriPerkkio in #3407 (a2cc2) -
rejects&resolvesbreaks with thenable objects - by @fenghan34 in #3456 (4e996) - Prevent
birpctimeouts whenMath.randommock is not restored - by @AriPerkkio in #3460 (cd5d5) - Assertion diff message now handle non writable property correctly - by @PCreations in #3422 (f75ab)
- Extend logging of process timeout errors - by @AriPerkkio in #3452 (42643)
- Support requiring files with
lessextension - by @rluvaton in #3465 (4d045) -
cli:
- Improve colors used when erroring - by @ghiscoding and @sheremet-va in #3349 (16681)
- runner:
-
spy:
- Don't print received calls if there are no calls - by @sheremet-va in #3405 (41e11)
-
typecheck:
- Show tsc errors not related to test files - by @sheremet-va in #3441 (a1da5)
- types:
-
vite-node:
- Circular import stuck - by @Dunqing in #3418 (632ee)
- Coerce to string in import(dep) - by @jcbhmr and @sheremet-va in #3430 (b72eb)
- Don't remove sourcemap string in source code - by @rxliuli and @sheremet-va in #2918 and #3379 (02dc9)
- Don't externalize "dist" by default - by @sheremet-va in #3446 (306b2)
View changes on GitHub
v0.31.1
🚀 Features
-
watch: Press
rshould 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
cwdfrom test name filter - by @AriPerkkio in #3353 (324a9) - Check error type before modifying it - by @sheremet-va in #3385 (c44d9)
-
toMatchInlineSnapshotfails 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
browserfrom allowed pools insidepoolMatchGlobconfig 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.hoistedto 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:
--bailoption 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:
- Failing to load vitest/utils - by @userquin in #3190 (78bad)
-
coverage:
-
thresholdAutoUpdateto 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
performanceandAggregateError- by @sheremet-va in #3171 (cce45) - Allow workspace without a config in the root - by @sheremet-va in #3173 (06852)
-
test.eachrespectschaiConfig- 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
toMatchFileSnapshotand 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
istanbulcoverage 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
🐞 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 #3039 (865d1)
View changes on GitHub
v0.29.4
🚀 Features
-
--test-timeoutCLI 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
anyas default value for TArgs in vi.fn() - by @jessevanassen in #2947 (1bdcc)
🏎️ Performance
- reporters: Overall improvements - by @AriPerkkio in #3006 (22ca0)
View changes on GitHub
v0.29.2
🐞 Bug Fixes
- Optimize dependencies in setup files - by @sheremet-va in #2935 (c169f)
- coverage: C8 provider to work when isolate:false - by @AriPerkkio in #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 #2836 (94247)
- Coverage-c8 to use V8 profiler directly instead of
NODE_V8_COVERAGE- by @AriPerkkio in #2786 (095c6) - Add a link to the comment at the top of the snapshot file - by @btea in #2867 (615e1)
- Always run separate environments in isolation - by @sheremet-va in #2860 (1f858)
- Tests with
nodeandjsdom(and other environments) now don't share the same global scope, if you run them with--no-isolateor--no-threadsflag. 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 #2772 (7bf54)
- Tests inside
chid_processmight 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 #2877 (bdb39)
- Use custom source-map-support implementation - by @sheremet-va in #2905 (6ff6c)
- Add an option to enable Vite optimizer - by @sheremet-va in #2912 (af8de)
-
coverage:
- Add support for coverage reporter options - by @AriPerkkio in #2690 (f8176)
- Automatic threshold updating - by @AriPerkkio in #2886 (e1652)
-
spy:
- Implement mock.withImplementation API - by @obadakhalili and @sheremet-va in #2835 (610b1)
- vite-node:
🐞 Bug Fixes
- Wait for console.log to print a message before terminating a worker - by @sheremet-va in #2861 (fbc54)
- Cleanup last mocked cache when call vi.doMock - by @mysteryven in #2872 (65d71)
- Reload changed configuration file on watch mode - by @AriPerkkio in #2889 (4d277)
- coverage: Custom providers to work inside worker threads - by @AriPerkkio in #2817 (81604)
View changes on GitHub
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.