Update dependency vitest to v2.1.0
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| vitest (source) | 2.0.0 -> 2.1.0 |
Release Notes
vitest-dev/vitest (vitest)
v2.1.0
This release makes another big change to the Browser Mode by introducing locators API:
test('renders blog posts', async () => {
const screen = page.render(<Blog />)
await expect.element(screen.getByRole('heading', { name: 'Blog' })).toBeInTheDocument()
const [firstPost] = screen.getByRole('listitem').all()
await firstPost.getByRole('button', { name: 'Delete' }).click()
expect(screen.getByRole('listitem').all()).toHaveLength(3)
})
You can use either vitest-browser-vue, vitest-browser-svelte or vitest-browser-react to render components and make assertions using locators. Locators are also available on the page object from @vitest/browser/context.
🚀 Features
- api:
- Make spec into a class instead of a tuple - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6355 (874a1)
- browser:
- Move page.config to server.config, add more docs - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6252 (af2b8)
- Make iframe scalable, improve documentation - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6257 (74ca1)
- Introduce built-in locators - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6084 (3347f)
- Support v8 coverage - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6273 (34199)
- Support
userEvent.uploadin playwright provider - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6442 (cf148) - Support
--inspect- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6433 (0499a) - Support
--inspect-brk- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6434 (7ab0f)
- cli:
- Extend existing list command to output only a list of file names - by @Ma-hawaj and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6392 (008f0)
- coverage:
- Add
--exclude-after-remap- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6309 (5932a)
- Add
- mocker:
- Introduce @vitest/mocker package, allow
{ spy: true }instead of a factory - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6289 (95f02)
- Introduce @vitest/mocker package, allow
- vitest:
- Add "provide" option - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6253 (4409d)
- Add return type and promisable mockFactory - by @syi0808 and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6139 (f5e0b)
- Add
vi.advanceTimersToNextFrame- by @bnjm and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6347 (8ff63) - Allow env to be stubbed to undefined - by @JSanchezIO and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6359 (c3b27)
🐞 Bug Fixes
- Correctly resolve nested mocks with
indexfile - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6266 (081cf) - Don't panic when coverage.reporter is a string - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6267 (7b37d)
- Align RawMatcherFn type definition with Jest - by @wheresrhys in https://github.com/vitest-dev/vitest/issues/6351 (d09f0)
- Cjs build of vite node server - by @AkaraChen in https://github.com/vitest-dev/vitest/issues/6389 (12e70)
- Allow inlining vite's cached dependencies - by @chriswheeldon-peakon in https://github.com/vitest-dev/vitest/issues/6284 (03208)
- Print unexpected error message if peer dependencies have a different version - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6446 (b992b)
- Ignore importer when resolving Vitest - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6469 (0b447)
expect.getState().testPathalways returns correct path - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6472 (ac698)- UserEvent works consistently between providers - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6480 (0b4da)
- browser:
- Print correct stack trace for unhandled errors - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6134 (1da6c)
- Use documentElement as the root for selector - by @sheremet-va (d8077)
- Keep querying elements even if locator is created with elementLocator, add pubic @vitest/browser/utils - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6296 (30dc5)
- Produce valid config file if preview provider is used - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6305 (7f0ae)
- Correctly run in-source tests in the browser - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6440 (c8531)
- Exclude missed packages from optimization, print help message - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6445 (8d883)
- Define mocker as a dependency - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6476 (9560a)
- coverage:
- Warn if
vitestand@vitest/*versions don't match - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6317 (e662c) - V8 to support source maps with multiple sources - by @AriPerkkio and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6120 (1f6cb)
- V8 to warn instead of crash when conversion fails - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6318 (91dea)
- Use project specific
vitenodefor uncovered files - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6044 (da52d)
- Warn if
- runner:
- Use
performance.nowinstead ofDate.nowfor duration - by @LuciNyan in https://github.com/vitest-dev/vitest/issues/6382 (fe489) - Async assertion auto await should timeout - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6391 (ad6e7)
- Use
- snapshot:
- Reject multiple
toMatchInlineSnapshotupdates at the same location - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6332 (1606f) - Improve inline snapshot inside loop rejection - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6339 (e0368)
- Reject multiple
- typecheck:
- Run both runtime and typecheck tests if
typecheck.includeoverlaps withinclude- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6256 (153ff)
- Run both runtime and typecheck tests if
- types:
- Allow Callbacks Passed to before*/after* to Return Anything - by @LuciNyan in https://github.com/vitest-dev/vitest/issues/6393 (f6217)
- ui:
- Remove "filters" flickering - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6463 (0223b)
- Render project name consistently - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6329 (94a18)
- vite-node:
- Disable watcher if hmr is disabled - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6251 (c51c6)
- Fix watch on vite 6 - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6422 (c3ac4)
- vitest:
- Update json reporter output - by @Emiyaaaaa in https://github.com/vitest-dev/vitest/issues/6064 (c9979)
- Add more type guards for --merge-reports - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6307 (0a5d8)
- Always resolve vitest to the root version - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6369 (163d7)
- Dispose vmForks listeners to avoid memory leak - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6448 (2673c)
- workspace:
- Correctly resolve workspace globs and file paths - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6316 (afdcb)
View changes on GitHub
v2.0.5
🚀 Features
- Introduce experimental reported tasks - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6149 (13d85)
- This is part of the experimental API and doesn't follow semver. We are hoping to stabilize it for 2.1. If you are working with custom reporters, give this a go!
🐞 Bug Fixes
- Show a difference between string characters if both values are strings - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6191 (29176)
testNamePatternadds leading space - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6186 (073a5)- browser:
- Don't bundle
afterEachcleanup hooks in node entrypoint - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6192 (e6fbc) - UserEvent.setup initiates a separate state for userEvent instance - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6088 (883f3)
- Correctly import optimized module in vi.importActual - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6219 (804ff)
- Passing options to hover/unhover - by @MNeverOff in https://github.com/vitest-dev/vitest/issues/6175 (d4c00)
- Improve unique CSS selector generation - by @zacharyvoase and Zack Voase in https://github.com/vitest-dev/vitest/issues/6243 (e7acd)
- Don't bundle
- vitest:
- Remove nuxt from auto inline deps - by @sheremet-va (93882)
- Improve
defineProjectanddefineWorkspacetypes - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6198 (8cd82) - Correctly resolve mocked
node:*imports in__mocks__folder - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6204 (a48be)
- web-worker:
- Expose globals on self - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6170 (12bb5)
View changes on GitHub
v2.0.4
🐞 Bug Fixes
- One-line environment options - by @hahanein in https://github.com/vitest-dev/vitest/issues/5105 (38269)
- Resolve assets imported with
require- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6159 (807a2) - browser:
- Don't panic if @vitest/browser is installed outside of project root - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6135 (ccfcd)
- Set global filepath - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6190 (0d0b4)
- Allow preview and open in the editor screenshot error from ui - by @userquin in https://github.com/vitest-dev/vitest/issues/6113 (2d620)
- coverage:
- Global thresholds to include files from glob thresholds - by @thor-juhasz and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6172 (02e3f)
- Consistent type-only file handling - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6183 (90576)
- Ignore
*.ctsfiles - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6189 (5da45) - Add
thresholds.<glob>.100option - by @thor-juhasz and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6174 (f6845)
- spy:
- Fix
mockImplementationfor function overload and unions - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6181 (7a75b)
- Fix
View changes on GitHub
v2.0.3
🚀 Features
- ui: Show all suites/tests when parent matches - by @userquin in https://github.com/vitest-dev/vitest/issues/6106 (840e0)
🐞 Bug Fixes
--inspect-brkstop on Windows - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6110 (f8519)- browser:
- Don't import from "vite" - by @sheremet-va (35655)
- Allow immidiate reinvalidation of mocked dependencies - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6108 (f44cc)
- spy:
- Fix type error when assigning
vi.spyOntoMockInstanceof function overload - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6086 (e9f9a)
- Fix type error when assigning
- vite-node:
- Remove suffix slash on file protocol for window - by @syi0808 in https://github.com/vitest-dev/vitest/issues/6109 (93ebd)
View changes on GitHub
v2.0.2
v2.0.1
🐞 Bug Fixes
- browser: Correctly inherit browser config in a workspace - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6054 (4b03e)
- ui: Move virtual scroller to dev dependencies - by @userquin in https://github.com/vitest-dev/vitest/issues/6053 (f94ed)
- vitest: Print only running files, not every file - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6052 (4d559)
View changes on GitHub
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.