v4.1.0-beta.3
📦 vitestView on GitHub →
✨ 8 features🐛 16 fixes🔧 9 symbols
Summary
This release introduces new lifecycle hooks (`aroundEach`, `aroundAll`) and stabilizes several experimental features, including import duration tracking. Numerous bug fixes address issues across SSR handling, browser testing, and assertion logic.
✨ New Features
- Implement `aroundEach` and `aroundAll` hooks.
- Stabilize experimental features.
- Accept `new` or `all` in --update flag.
- Support `meta` in test options.
- Add `allowWrite` and `allowExec` options to `api`.
- Browser: Added `detailsPanelPosition` option and button.
- Experimental: Add `importDurations: { limit, print }` options.
- Experimental: Add print and fail thresholds for `importDurations`.
🐛 Bug Fixes
- Handle `external/noExternal` during `configEnvironment` hook.
- Replace default ssr environment runner with Vitest server module runner.
- Propagate experimental CLI options to child projects.
- Show a warning when `browser.isolate` is used.
- Fix `vi.mock({ spy: true })` node v8 coverage.
- Don't show internal ssr handler in errors.
- Browser: Hide injected data-testid attributes.
- Browser: Throw an error if iframe was reloaded.
- Browser: Encode projectName in browser client URL.
- Browser: Don't take failure screenshot if tests have artifacts created by `toMatchScreenshot`.
- Deps: Update all non-major dependencies (two separate updates noted).
- Expect: `toMatchObject(Map/Set)` should expect `Map/Set` on left hand side.
- Expect: Fix objectContaining with proxy.
- Mock: Inject helpers after hashbang if present.
- Spy: Fallback to object accessor if descriptor's value is `undefined`.
- Spy: Throw correct errors when shorthand methods are used on a class.