v0.34.0
版本发布时间: 2023-08-01 23:40:58
vitest-dev/vitest最新发布版本:v3.0.0-beta.2(2024-12-10 18:22:19)
🚨 Breaking Changes
- Transform mode affects only test files, not regular files - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3491 (9608b)
-
transformMode
is now moved toserver.transformMode
. This option is highly discouraged to use. If you need to change the transform mode, use the new optiontestTransformMode
instead to control the mode based on the running test, not the current file path. By default, tests withjsdom
orhappy-dom
useweb
transform mode, and tests usingnode
oredge
environment usessr
mode. If you have a custom environment, it should providetransformMode
property.
-
- 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.reportOnFailure
by default - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3615 (0c6f6) - Remove
@vitest/coverage-c8
package - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3614 (a90d6)-
@vitest/coverage-c8
is no longer supported. Please, use@vitest/coverage-v8
instead.
-
- Support running tests using VM context - by @sheremet-va and @dammy001 in https://github.com/vitest-dev/vitest/issues/3203 (b0929)
- To address speed issues in some applications, Vitest now provides
experimentalVmThreads
pool 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
server
option - by @fenghan34 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/3725 (dc4fa)- Most of
deps.
options are now moved toserver.deps
with a deprecation warning. Please, consider usingdeps.optimizer
instead ofdeps.inline
/deps.external
. Ideally, we would like to move away from usingserver.deps.inline
altogether.
- Most of
-
vite-node: Make CLI arguments parsing behavior consistent with node/tsx/ts-node - by @rxliuli in https://github.com/vitest-dev/vitest/issues/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 https://github.com/vitest-dev/vitest/issues/3854 (4b946)
-
deps.optimizer
is now enabled by default. This means that Vitest will bundle specified dependencies before running your tests. This field inherits options fromoptimizeDeps
andssr.optimizeDeps
which are populated by other plugins (like, Svelte).
-
🚀 Features
- Support
describe.sequential
- by @fenghan34 and @dammy001 in https://github.com/vitest-dev/vitest/issues/3771 (86934) - Support config junit reporter className with env - by @InfiniteXyy in https://github.com/vitest-dev/vitest/issues/3808 (e8bc4)
- Running vitest with
--related --watch
reruns non-affected tests if they were changed during a run - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/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
defineConfig
type from vite - by @sodatea in https://github.com/vitest-dev/vitest/issues/3804 (9c8e3) - Don't overwrite Node.js URL global - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3828 (cdab4)
- ForceRerunTriggers correctly triggers a rerun - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3829 (17988)
-
browser:
- Don't inline magic-string and estree-walker - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3726 (ee937)
- Multi-suite coverage - by @elby22 in https://github.com/vitest-dev/vitest/issues/3806 (5de9a)
-
core:
- DataView comparison does not work in
toStrictEqual
- by @Dunqing (52aef)
- DataView comparison does not work in
-
coverage:
- V8 provider to pick source maps without url query params - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3784 (280e6)
- Update
istanbul-lib-instrument
to v6 to fix vulnerable dependency - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3814 (f3bd9) - Exclude vite virtual modules by default - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3794 (3c851)
-
node:
- Guard error info - by @btea (88b39)
-
vite-node:
- Always treat node_modules as modulesDirectory - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3830 (51ab8)
- Normalize drive letter to keep the same reference to a module - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3836 (45521)
- Correctly resolve hmr filepath - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/3834 (711a6)
-
watch:
- Clear screen on all terminals - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/3661 (8bd26)
🏎 Performance
- Deprecate deps.registerNodeLoader - by @sheremet-va (7f45b)
- This option was introduced to support aliasing inside external packages. Please, use
deps.optimizer.web
instead. 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