-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(runner): Use performance.now
instead of Date.now
for duration
#6382
fix(runner): Use performance.now
instead of Date.now
for duration
#6382
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
c5a11aa
to
825f178
Compare
Hi team! 👋 |
packages/runner/src/run.ts
Outdated
@@ -181,7 +181,7 @@ export async function runTest(test: Test | Custom, runner: VitestRunner): Promis | |||
|
|||
test.result = { | |||
state: 'run', | |||
startTime: start, | |||
startTime: Date.now(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
packages/runner/src/run.ts
Outdated
@@ -376,7 +376,7 @@ export async function runSuite(suite: Suite, runner: VitestRunner): Promise<void | |||
|
|||
suite.result = { | |||
state: 'run', | |||
startTime: start, | |||
startTime: Date.now(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! @sheremet-va 👋
Date.now() gives us milliseconds since 1970, but performance.now() doesn't.
The name 'startTime' implies it might be used as a specific timestamp, like in test/cli/test/reported-tasks.test.ts:106
.
const diagnostic = passedTest.diagnostic()!
expect(diagnostic).toBeDefined()
expect(diagnostic.heap).toBeGreaterThan(0)
expect(diagnostic.duration).toBeGreaterThan(0)
expect(date(new Date(diagnostic.startTime))).toBe(date(now))
expect(diagnostic.flaky).toBe(false)
expect(diagnostic.repeatCount).toBe(0)
expect(diagnostic.repeatCount).toBe(0)
If we switch to performance.now(), we'll probably need to update that test file. So, do I need to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would expect it to use the new now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! I've made the changes you suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sheremet-va 👋,
I've noticed something important about our test execution, particularly for files like test/reporters/tests/merge-reports.test.ts
. We're using Tinypool
from packages/vitest/src/node/pools/forks.ts
to spawn new processes for these tests.
The issue is with our use of performance.now()
. While it works fine for timing within a single process, it becomes problematic across multiple processes. Each process has its own time reference for performance.now()
, starting from when that process begins.
This causes issues when we try to use these startTime
values for sorting in packages/vitest/src/node/reporters/blob.ts
. The times from different processes aren't comparable.
const files = blobs
.flatMap(blob => blob.files)
.sort((f1, f2) => {
const time1 = f1.result?.startTime || 0
const time2 = f2.result?.startTime || 0
return time1 - time2
})
Given this, I still think we should use Date.now()
for startTime
. It provides a consistent timestamp across all processes.
What are your thoughts on this? Do you see any potential drawbacks to switching to Date.now()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I see. Let's keep using Date.now
then, but we need to store it before it's called because it can be overwritten by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review! 🚀
6b6099c
to
bf57d53
Compare
97432f9
to
38c8a4b
Compare
38c8a4b
to
d6da130
Compare
performance.now
instead of Date.now
for duration
performance.now
instead of Date.now
for durationperformance.now
instead of Date.now
for duration
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-v8](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [vitest](https://redirect.github.com/vitest-dev/vitest) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/vitest/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v2.1.0`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://redirect.github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://redirect.github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://redirect.github.com/vitest-dev/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](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6355](https://redirect.github.com/vitest-dev/vitest/issues/6355) [<samp>(874a1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6252](https://redirect.github.com/vitest-dev/vitest/issues/6252) [<samp>(af2b8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/af2b813c) - Make iframe scalable, improve documentation - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6257](https://redirect.github.com/vitest-dev/vitest/issues/6257) [<samp>(74ca1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/74ca11a4) - Introduce built-in locators - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6084](https://redirect.github.com/vitest-dev/vitest/issues/6084) [<samp>(3347f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/3347f83e) - Support v8 coverage - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6273](https://redirect.github.com/vitest-dev/vitest/issues/6273) [<samp>(34199)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/34199bdf) - Support `userEvent.upload` in playwright provider - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6442](https://redirect.github.com/vitest-dev/vitest/issues/6442) [<samp>(cf148)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/cf148645) - Support `--inspect` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6433](https://redirect.github.com/vitest-dev/vitest/issues/6433) [<samp>(0499a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0499a315) - Support `--inspect-brk` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6434](https://redirect.github.com/vitest-dev/vitest/issues/6434) [<samp>(7ab0f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@​Ma-hawaj](https://redirect.github.com/Ma-hawaj) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6392](https://redirect.github.com/vitest-dev/vitest/issues/6392) [<samp>(008f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6309](https://redirect.github.com/vitest-dev/vitest/issues/6309) [<samp>(5932a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/5932a7f9) - **mocker**: - Introduce [@​vitest/mocker](https://redirect.github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6289](https://redirect.github.com/vitest-dev/vitest/issues/6289) [<samp>(95f02)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/95f0203f) - **vitest**: - Add "provide" option - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6253](https://redirect.github.com/vitest-dev/vitest/issues/6253) [<samp>(4409d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/4409d779) - Add return type and promisable mockFactory - by [@​syi0808](https://redirect.github.com/syi0808) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6139](https://redirect.github.com/vitest-dev/vitest/issues/6139) [<samp>(f5e0b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@​bnjm](https://redirect.github.com/bnjm) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6347](https://redirect.github.com/vitest-dev/vitest/issues/6347) [<samp>(8ff63)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8ff63560) - Allow env to be stubbed to undefined - by [@​JSanchezIO](https://redirect.github.com/JSanchezIO) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6359](https://redirect.github.com/vitest-dev/vitest/issues/6359) [<samp>(c3b27)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6266](https://redirect.github.com/vitest-dev/vitest/issues/6266) [<samp>(081cf)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/081cfe03) - Don't panic when coverage.reporter is a string - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6267](https://redirect.github.com/vitest-dev/vitest/issues/6267) [<samp>(7b37d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7b37d27b) - Align RawMatcherFn type definition with Jest - by [@​wheresrhys](https://redirect.github.com/wheresrhys) in [https://github.com/vitest-dev/vitest/issues/6351](https://redirect.github.com/vitest-dev/vitest/issues/6351) [<samp>(d09f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d09f00c7) - Cjs build of vite node server - by [@​AkaraChen](https://redirect.github.com/AkaraChen) in [https://github.com/vitest-dev/vitest/issues/6389](https://redirect.github.com/vitest-dev/vitest/issues/6389) [<samp>(12e70)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/12e702bd) - Allow inlining vite's cached dependencies - by [@​chriswheeldon-peakon](https://redirect.github.com/chriswheeldon-peakon) in [https://github.com/vitest-dev/vitest/issues/6284](https://redirect.github.com/vitest-dev/vitest/issues/6284) [<samp>(03208)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/03208017) - Print unexpected error message if peer dependencies have a different version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6446](https://redirect.github.com/vitest-dev/vitest/issues/6446) [<samp>(b992b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/b992b346) - Ignore importer when resolving Vitest - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6469](https://redirect.github.com/vitest-dev/vitest/issues/6469) [<samp>(0b447)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b447226) - `expect.getState().testPath` always returns correct path - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6472](https://redirect.github.com/vitest-dev/vitest/issues/6472) [<samp>(ac698)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ac698b1c) - UserEvent works consistently between providers - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6480](https://redirect.github.com/vitest-dev/vitest/issues/6480) [<samp>(0b4da)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6134](https://redirect.github.com/vitest-dev/vitest/issues/6134) [<samp>(1da6c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1da6cebe) - Use documentElement as the root for selector - by [@​sheremet-va](https://redirect.github.com/sheremet-va) [<samp>(d8077)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @​vitest/browser/utils - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6296](https://redirect.github.com/vitest-dev/vitest/issues/6296) [<samp>(30dc5)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/30dc5793) - Produce valid config file if preview provider is used - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6305](https://redirect.github.com/vitest-dev/vitest/issues/6305) [<samp>(7f0ae)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7f0ae292) - Correctly run in-source tests in the browser - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6440](https://redirect.github.com/vitest-dev/vitest/issues/6440) [<samp>(c8531)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c853126e) - Exclude missed packages from optimization, print help message - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6445](https://redirect.github.com/vitest-dev/vitest/issues/6445) [<samp>(8d883)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8d883cf0) - Define mocker as a dependency - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6476](https://redirect.github.com/vitest-dev/vitest/issues/6476) [<samp>(9560a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6317](https://redirect.github.com/vitest-dev/vitest/issues/6317) [<samp>(e662c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e662c7b2) - V8 to support source maps with multiple sources - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6120](https://redirect.github.com/vitest-dev/vitest/issues/6120) [<samp>(1f6cb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6318](https://redirect.github.com/vitest-dev/vitest/issues/6318) [<samp>(91dea)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/91dea8c1) - Use project specific `vitenode` for uncovered files - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6044](https://redirect.github.com/vitest-dev/vitest/issues/6044) [<samp>(da52d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6382](https://redirect.github.com/vitest-dev/vitest/issues/6382) [<samp>(fe489)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/fe489432) - Async assertion auto await should timeout - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6391](https://redirect.github.com/vitest-dev/vitest/issues/6391) [<samp>(ad6e7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6332](https://redirect.github.com/vitest-dev/vitest/issues/6332) [<samp>(1606f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1606f34f) - Improve inline snapshot inside loop rejection - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6339](https://redirect.github.com/vitest-dev/vitest/issues/6339) [<samp>(e0368)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6256](https://redirect.github.com/vitest-dev/vitest/issues/6256) [<samp>(153ff)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6393](https://redirect.github.com/vitest-dev/vitest/issues/6393) [<samp>(f6217)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f6217a22) - **ui**: - Remove "filters" flickering - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6463](https://redirect.github.com/vitest-dev/vitest/issues/6463) [<samp>(0223b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0223bb79) - Render project name consistently - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6329](https://redirect.github.com/vitest-dev/vitest/issues/6329) [<samp>(94a18)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6251](https://redirect.github.com/vitest-dev/vitest/issues/6251) [<samp>(c51c6)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c51c67aa) - Fix watch on vite 6 - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6422](https://redirect.github.com/vitest-dev/vitest/issues/6422) [<samp>(c3ac4)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3ac43c1) - **vitest**: - Update json reporter output - by [@​Emiyaaaaa](https://redirect.github.com/Emiyaaaaa) in [https://github.com/vitest-dev/vitest/issues/6064](https://redirect.github.com/vitest-dev/vitest/issues/6064) [<samp>(c9979)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c997937b) - Add more type guards for --merge-reports - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6307](https://redirect.github.com/vitest-dev/vitest/issues/6307) [<samp>(0a5d8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0a5d8169) - Always resolve vitest to the root version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6369](https://redirect.github.com/vitest-dev/vitest/issues/6369) [<samp>(163d7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/163d7624) - Dispose vmForks listeners to avoid memory leak - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6448](https://redirect.github.com/vitest-dev/vitest/issues/6448) [<samp>(2673c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6316](https://redirect.github.com/vitest-dev/vitest/issues/6316) [<samp>(afdcb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/afdcb8f2) ##### [View changes on GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/line/line-bot-sdk-nodejs). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJkZXBlbmRlbmN5IHVwZ3JhZGUiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
##### [v2.1.0](https://github.com/vitest-dev/vitest/releases/tag/v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://github.com/vitest-dev/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](https://github.com/sheremet-va) in vitest-dev/vitest#6355 [<samp>(874a1)</samp>](vitest-dev/vitest@874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6252 [<samp>(af2b8)</samp>](vitest-dev/vitest@af2b813c) - Make iframe scalable, improve documentation - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6257 [<samp>(74ca1)</samp>](vitest-dev/vitest@74ca11a4) - Introduce built-in locators - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6084 [<samp>(3347f)</samp>](vitest-dev/vitest@3347f83e) - Support v8 coverage - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6273 [<samp>(34199)</samp>](vitest-dev/vitest@34199bdf) - Support `userEvent.upload` in playwright provider - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6442 [<samp>(cf148)</samp>](vitest-dev/vitest@cf148645) - Support `--inspect` - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6433 [<samp>(0499a)</samp>](vitest-dev/vitest@0499a315) - Support `--inspect-brk` - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6434 [<samp>(7ab0f)</samp>](vitest-dev/vitest@7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@Ma-hawaj](https://github.com/Ma-hawaj) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6392 [<samp>(008f0)</samp>](vitest-dev/vitest@008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6309 [<samp>(5932a)</samp>](vitest-dev/vitest@5932a7f9) - **mocker**: - Introduce [@vitest/mocker](https://github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6289 [<samp>(95f02)</samp>](vitest-dev/vitest@95f0203f) - **vitest**: - Add "provide" option - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6253 [<samp>(4409d)</samp>](vitest-dev/vitest@4409d779) - Add return type and promisable mockFactory - by [@syi0808](https://github.com/syi0808) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6139 [<samp>(f5e0b)</samp>](vitest-dev/vitest@f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@bnjm](https://github.com/bnjm) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6347 [<samp>(8ff63)</samp>](vitest-dev/vitest@8ff63560) - Allow env to be stubbed to undefined - by [@JSanchezIO](https://github.com/JSanchezIO) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6359 [<samp>(c3b27)</samp>](vitest-dev/vitest@c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6266 [<samp>(081cf)</samp>](vitest-dev/vitest@081cfe03) - Don't panic when coverage.reporter is a string - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6267 [<samp>(7b37d)</samp>](vitest-dev/vitest@7b37d27b) - Align RawMatcherFn type definition with Jest - by [@wheresrhys](https://github.com/wheresrhys) in vitest-dev/vitest#6351 [<samp>(d09f0)</samp>](vitest-dev/vitest@d09f00c7) - Cjs build of vite node server - by [@AkaraChen](https://github.com/AkaraChen) in vitest-dev/vitest#6389 [<samp>(12e70)</samp>](vitest-dev/vitest@12e702bd) - Allow inlining vite's cached dependencies - by [@chriswheeldon-peakon](https://github.com/chriswheeldon-peakon) in vitest-dev/vitest#6284 [<samp>(03208)</samp>](vitest-dev/vitest@03208017) - Print unexpected error message if peer dependencies have a different version - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6446 [<samp>(b992b)</samp>](vitest-dev/vitest@b992b346) - Ignore importer when resolving Vitest - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6469 [<samp>(0b447)</samp>](vitest-dev/vitest@0b447226) - `expect.getState().testPath` always returns correct path - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6472 [<samp>(ac698)</samp>](vitest-dev/vitest@ac698b1c) - UserEvent works consistently between providers - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6480 [<samp>(0b4da)</samp>](vitest-dev/vitest@0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6134 [<samp>(1da6c)</samp>](vitest-dev/vitest@1da6cebe) - Use documentElement as the root for selector - by [@sheremet-va](https://github.com/sheremet-va) [<samp>(d8077)</samp>](vitest-dev/vitest@d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @vitest/browser/utils - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6296 [<samp>(30dc5)</samp>](vitest-dev/vitest@30dc5793) - Produce valid config file if preview provider is used - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6305 [<samp>(7f0ae)</samp>](vitest-dev/vitest@7f0ae292) - Correctly run in-source tests in the browser - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6440 [<samp>(c8531)</samp>](vitest-dev/vitest@c853126e) - Exclude missed packages from optimization, print help message - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6445 [<samp>(8d883)</samp>](vitest-dev/vitest@8d883cf0) - Define mocker as a dependency - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6476 [<samp>(9560a)</samp>](vitest-dev/vitest@9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6317 [<samp>(e662c)</samp>](vitest-dev/vitest@e662c7b2) - V8 to support source maps with multiple sources - by [@AriPerkkio](https://github.com/AriPerkkio) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6120 [<samp>(1f6cb)</samp>](vitest-dev/vitest@1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6318 [<samp>(91dea)</samp>](vitest-dev/vitest@91dea8c1) - Use project specific `vitenode` for uncovered files - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6044 [<samp>(da52d)</samp>](vitest-dev/vitest@da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@LuciNyan](https://github.com/LuciNyan) in vitest-dev/vitest#6382 [<samp>(fe489)</samp>](vitest-dev/vitest@fe489432) - Async assertion auto await should timeout - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6391 [<samp>(ad6e7)</samp>](vitest-dev/vitest@ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6332 [<samp>(1606f)</samp>](vitest-dev/vitest@1606f34f) - Improve inline snapshot inside loop rejection - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6339 [<samp>(e0368)</samp>](vitest-dev/vitest@e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6256 [<samp>(153ff)</samp>](vitest-dev/vitest@153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@LuciNyan](https://github.com/LuciNyan) in vitest-dev/vitest#6393 [<samp>(f6217)</samp>](vitest-dev/vitest@f6217a22) - **ui**: - Remove "filters" flickering - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6463 [<samp>(0223b)</samp>](vitest-dev/vitest@0223bb79) - Render project name consistently - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6329 [<samp>(94a18)</samp>](vitest-dev/vitest@94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6251 [<samp>(c51c6)</samp>](vitest-dev/vitest@c51c67aa) - Fix watch on vite 6 - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6422 [<samp>(c3ac4)</samp>](vitest-dev/vitest@c3ac43c1) - **vitest**: - Update json reporter output - by [@Emiyaaaaa](https://github.com/Emiyaaaaa) in vitest-dev/vitest#6064 [<samp>(c9979)</samp>](vitest-dev/vitest@c997937b) - Add more type guards for --merge-reports - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6307 [<samp>(0a5d8)</samp>](vitest-dev/vitest@0a5d8169) - Always resolve vitest to the root version - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6369 [<samp>(163d7)</samp>](vitest-dev/vitest@163d7624) - Dispose vmForks listeners to avoid memory leak - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6448 [<samp>(2673c)</samp>](vitest-dev/vitest@2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6316 [<samp>(afdcb)</samp>](vitest-dev/vitest@afdcb8f2) ##### [View changes on GitHub](vitest-dev/vitest@v2.0.5...v2.1.0)
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-v8](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@vitest/ui](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/ui#readme) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/ui)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/@vitest%2fui/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fui/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fui/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fui/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fui/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [vitest](https://redirect.github.com/vitest-dev/vitest) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/vitest/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v2.1.0`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v2.1.0) [Compare Source](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://redirect.github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://redirect.github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://redirect.github.com/vitest-dev/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](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6355](https://redirect.github.com/vitest-dev/vitest/issues/6355) [<samp>(874a1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6252](https://redirect.github.com/vitest-dev/vitest/issues/6252) [<samp>(af2b8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/af2b813c) - Make iframe scalable, improve documentation - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6257](https://redirect.github.com/vitest-dev/vitest/issues/6257) [<samp>(74ca1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/74ca11a4) - Introduce built-in locators - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6084](https://redirect.github.com/vitest-dev/vitest/issues/6084) [<samp>(3347f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/3347f83e) - Support v8 coverage - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6273](https://redirect.github.com/vitest-dev/vitest/issues/6273) [<samp>(34199)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/34199bdf) - Support `userEvent.upload` in playwright provider - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6442](https://redirect.github.com/vitest-dev/vitest/issues/6442) [<samp>(cf148)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/cf148645) - Support `--inspect` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6433](https://redirect.github.com/vitest-dev/vitest/issues/6433) [<samp>(0499a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0499a315) - Support `--inspect-brk` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6434](https://redirect.github.com/vitest-dev/vitest/issues/6434) [<samp>(7ab0f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@​Ma-hawaj](https://redirect.github.com/Ma-hawaj) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6392](https://redirect.github.com/vitest-dev/vitest/issues/6392) [<samp>(008f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6309](https://redirect.github.com/vitest-dev/vitest/issues/6309) [<samp>(5932a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/5932a7f9) - **mocker**: - Introduce [@​vitest/mocker](https://redirect.github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6289](https://redirect.github.com/vitest-dev/vitest/issues/6289) [<samp>(95f02)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/95f0203f) - **vitest**: - Add "provide" option - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6253](https://redirect.github.com/vitest-dev/vitest/issues/6253) [<samp>(4409d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/4409d779) - Add return type and promisable mockFactory - by [@​syi0808](https://redirect.github.com/syi0808) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6139](https://redirect.github.com/vitest-dev/vitest/issues/6139) [<samp>(f5e0b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@​bnjm](https://redirect.github.com/bnjm) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6347](https://redirect.github.com/vitest-dev/vitest/issues/6347) [<samp>(8ff63)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8ff63560) - Allow env to be stubbed to undefined - by [@​JSanchezIO](https://redirect.github.com/JSanchezIO) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6359](https://redirect.github.com/vitest-dev/vitest/issues/6359) [<samp>(c3b27)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6266](https://redirect.github.com/vitest-dev/vitest/issues/6266) [<samp>(081cf)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/081cfe03) - Don't panic when coverage.reporter is a string - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6267](https://redirect.github.com/vitest-dev/vitest/issues/6267) [<samp>(7b37d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7b37d27b) - Align RawMatcherFn type definition with Jest - by [@​wheresrhys](https://redirect.github.com/wheresrhys) in [https://github.com/vitest-dev/vitest/issues/6351](https://redirect.github.com/vitest-dev/vitest/issues/6351) [<samp>(d09f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d09f00c7) - Cjs build of vite node server - by [@​AkaraChen](https://redirect.github.com/AkaraChen) in [https://github.com/vitest-dev/vitest/issues/6389](https://redirect.github.com/vitest-dev/vitest/issues/6389) [<samp>(12e70)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/12e702bd) - Allow inlining vite's cached dependencies - by [@​chriswheeldon-peakon](https://redirect.github.com/chriswheeldon-peakon) in [https://github.com/vitest-dev/vitest/issues/6284](https://redirect.github.com/vitest-dev/vitest/issues/6284) [<samp>(03208)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/03208017) - Print unexpected error message if peer dependencies have a different version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6446](https://redirect.github.com/vitest-dev/vitest/issues/6446) [<samp>(b992b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/b992b346) - Ignore importer when resolving Vitest - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6469](https://redirect.github.com/vitest-dev/vitest/issues/6469) [<samp>(0b447)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b447226) - `expect.getState().testPath` always returns correct path - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6472](https://redirect.github.com/vitest-dev/vitest/issues/6472) [<samp>(ac698)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ac698b1c) - UserEvent works consistently between providers - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6480](https://redirect.github.com/vitest-dev/vitest/issues/6480) [<samp>(0b4da)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6134](https://redirect.github.com/vitest-dev/vitest/issues/6134) [<samp>(1da6c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1da6cebe) - Use documentElement as the root for selector - by [@​sheremet-va](https://redirect.github.com/sheremet-va) [<samp>(d8077)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @​vitest/browser/utils - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6296](https://redirect.github.com/vitest-dev/vitest/issues/6296) [<samp>(30dc5)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/30dc5793) - Produce valid config file if preview provider is used - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6305](https://redirect.github.com/vitest-dev/vitest/issues/6305) [<samp>(7f0ae)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7f0ae292) - Correctly run in-source tests in the browser - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6440](https://redirect.github.com/vitest-dev/vitest/issues/6440) [<samp>(c8531)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c853126e) - Exclude missed packages from optimization, print help message - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6445](https://redirect.github.com/vitest-dev/vitest/issues/6445) [<samp>(8d883)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8d883cf0) - Define mocker as a dependency - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6476](https://redirect.github.com/vitest-dev/vitest/issues/6476) [<samp>(9560a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6317](https://redirect.github.com/vitest-dev/vitest/issues/6317) [<samp>(e662c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e662c7b2) - V8 to support source maps with multiple sources - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6120](https://redirect.github.com/vitest-dev/vitest/issues/6120) [<samp>(1f6cb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6318](https://redirect.github.com/vitest-dev/vitest/issues/6318) [<samp>(91dea)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/91dea8c1) - Use project specific `vitenode` for uncovered files - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6044](https://redirect.github.com/vitest-dev/vitest/issues/6044) [<samp>(da52d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6382](https://redirect.github.com/vitest-dev/vitest/issues/6382) [<samp>(fe489)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/fe489432) - Async assertion auto await should timeout - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6391](https://redirect.github.com/vitest-dev/vitest/issues/6391) [<samp>(ad6e7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6332](https://redirect.github.com/vitest-dev/vitest/issues/6332) [<samp>(1606f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1606f34f) - Improve inline snapshot inside loop rejection - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6339](https://redirect.github.com/vitest-dev/vitest/issues/6339) [<samp>(e0368)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6256](https://redirect.github.com/vitest-dev/vitest/issues/6256) [<samp>(153ff)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6393](https://redirect.github.com/vitest-dev/vitest/issues/6393) [<samp>(f6217)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f6217a22) - **ui**: - Remove "filters" flickering - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6463](https://redirect.github.com/vitest-dev/vitest/issues/6463) [<samp>(0223b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0223bb79) - Render project name consistently - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6329](https://redirect.github.com/vitest-dev/vitest/issues/6329) [<samp>(94a18)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6251](https://redirect.github.com/vitest-dev/vitest/issues/6251) [<samp>(c51c6)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c51c67aa) - Fix watch on vite 6 - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6422](https://redirect.github.com/vitest-dev/vitest/issues/6422) [<samp>(c3ac4)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3ac43c1) - **vitest**: - Update json reporter output - by [@​Emiyaaaaa](https://redirect.github.com/Emiyaaaaa) in [https://github.com/vitest-dev/vitest/issues/6064](https://redirect.github.com/vitest-dev/vitest/issues/6064) [<samp>(c9979)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c997937b) - Add more type guards for --merge-reports - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6307](https://redirect.github.com/vitest-dev/vitest/issues/6307) [<samp>(0a5d8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0a5d8169) - Always resolve vitest to the root version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6369](https://redirect.github.com/vitest-dev/vitest/issues/6369) [<samp>(163d7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/163d7624) - Dispose vmForks listeners to avoid memory leak - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6448](https://redirect.github.com/vitest-dev/vitest/issues/6448) [<samp>(2673c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6316](https://redirect.github.com/vitest-dev/vitest/issues/6316) [<samp>(afdcb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/afdcb8f2) ##### [View changes on GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/BSStudio/bss-web-graphql-backend). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-istanbul](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/coverage-istanbul#readme) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul)) | [`^2.0.5` -> `^2.1.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-istanbul/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-istanbul/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fcoverage-istanbul/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fcoverage-istanbul/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-istanbul/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [vitest](https://redirect.github.com/vitest-dev/vitest) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`^2.0.5` -> `^2.1.0`](https://renovatebot.com/diffs/npm/vitest/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-istanbul)</summary> ### [`v2.1.0`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v2.1.0) [Compare Source](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://redirect.github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://redirect.github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://redirect.github.com/vitest-dev/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](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6355](https://redirect.github.com/vitest-dev/vitest/issues/6355) [<samp>(874a1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6252](https://redirect.github.com/vitest-dev/vitest/issues/6252) [<samp>(af2b8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/af2b813c) - Make iframe scalable, improve documentation - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6257](https://redirect.github.com/vitest-dev/vitest/issues/6257) [<samp>(74ca1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/74ca11a4) - Introduce built-in locators - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6084](https://redirect.github.com/vitest-dev/vitest/issues/6084) [<samp>(3347f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/3347f83e) - Support v8 coverage - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6273](https://redirect.github.com/vitest-dev/vitest/issues/6273) [<samp>(34199)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/34199bdf) - Support `userEvent.upload` in playwright provider - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6442](https://redirect.github.com/vitest-dev/vitest/issues/6442) [<samp>(cf148)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/cf148645) - Support `--inspect` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6433](https://redirect.github.com/vitest-dev/vitest/issues/6433) [<samp>(0499a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0499a315) - Support `--inspect-brk` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6434](https://redirect.github.com/vitest-dev/vitest/issues/6434) [<samp>(7ab0f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@​Ma-hawaj](https://redirect.github.com/Ma-hawaj) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6392](https://redirect.github.com/vitest-dev/vitest/issues/6392) [<samp>(008f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6309](https://redirect.github.com/vitest-dev/vitest/issues/6309) [<samp>(5932a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/5932a7f9) - **mocker**: - Introduce [@​vitest/mocker](https://redirect.github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6289](https://redirect.github.com/vitest-dev/vitest/issues/6289) [<samp>(95f02)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/95f0203f) - **vitest**: - Add "provide" option - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6253](https://redirect.github.com/vitest-dev/vitest/issues/6253) [<samp>(4409d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/4409d779) - Add return type and promisable mockFactory - by [@​syi0808](https://redirect.github.com/syi0808) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6139](https://redirect.github.com/vitest-dev/vitest/issues/6139) [<samp>(f5e0b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@​bnjm](https://redirect.github.com/bnjm) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6347](https://redirect.github.com/vitest-dev/vitest/issues/6347) [<samp>(8ff63)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8ff63560) - Allow env to be stubbed to undefined - by [@​JSanchezIO](https://redirect.github.com/JSanchezIO) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6359](https://redirect.github.com/vitest-dev/vitest/issues/6359) [<samp>(c3b27)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6266](https://redirect.github.com/vitest-dev/vitest/issues/6266) [<samp>(081cf)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/081cfe03) - Don't panic when coverage.reporter is a string - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6267](https://redirect.github.com/vitest-dev/vitest/issues/6267) [<samp>(7b37d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7b37d27b) - Align RawMatcherFn type definition with Jest - by [@​wheresrhys](https://redirect.github.com/wheresrhys) in [https://github.com/vitest-dev/vitest/issues/6351](https://redirect.github.com/vitest-dev/vitest/issues/6351) [<samp>(d09f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d09f00c7) - Cjs build of vite node server - by [@​AkaraChen](https://redirect.github.com/AkaraChen) in [https://github.com/vitest-dev/vitest/issues/6389](https://redirect.github.com/vitest-dev/vitest/issues/6389) [<samp>(12e70)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/12e702bd) - Allow inlining vite's cached dependencies - by [@​chriswheeldon-peakon](https://redirect.github.com/chriswheeldon-peakon) in [https://github.com/vitest-dev/vitest/issues/6284](https://redirect.github.com/vitest-dev/vitest/issues/6284) [<samp>(03208)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/03208017) - Print unexpected error message if peer dependencies have a different version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6446](https://redirect.github.com/vitest-dev/vitest/issues/6446) [<samp>(b992b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/b992b346) - Ignore importer when resolving Vitest - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6469](https://redirect.github.com/vitest-dev/vitest/issues/6469) [<samp>(0b447)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b447226) - `expect.getState().testPath` always returns correct path - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6472](https://redirect.github.com/vitest-dev/vitest/issues/6472) [<samp>(ac698)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ac698b1c) - UserEvent works consistently between providers - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6480](https://redirect.github.com/vitest-dev/vitest/issues/6480) [<samp>(0b4da)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6134](https://redirect.github.com/vitest-dev/vitest/issues/6134) [<samp>(1da6c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1da6cebe) - Use documentElement as the root for selector - by [@​sheremet-va](https://redirect.github.com/sheremet-va) [<samp>(d8077)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @​vitest/browser/utils - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6296](https://redirect.github.com/vitest-dev/vitest/issues/6296) [<samp>(30dc5)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/30dc5793) - Produce valid config file if preview provider is used - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6305](https://redirect.github.com/vitest-dev/vitest/issues/6305) [<samp>(7f0ae)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7f0ae292) - Correctly run in-source tests in the browser - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6440](https://redirect.github.com/vitest-dev/vitest/issues/6440) [<samp>(c8531)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c853126e) - Exclude missed packages from optimization, print help message - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6445](https://redirect.github.com/vitest-dev/vitest/issues/6445) [<samp>(8d883)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8d883cf0) - Define mocker as a dependency - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6476](https://redirect.github.com/vitest-dev/vitest/issues/6476) [<samp>(9560a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6317](https://redirect.github.com/vitest-dev/vitest/issues/6317) [<samp>(e662c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e662c7b2) - V8 to support source maps with multiple sources - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6120](https://redirect.github.com/vitest-dev/vitest/issues/6120) [<samp>(1f6cb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6318](https://redirect.github.com/vitest-dev/vitest/issues/6318) [<samp>(91dea)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/91dea8c1) - Use project specific `vitenode` for uncovered files - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6044](https://redirect.github.com/vitest-dev/vitest/issues/6044) [<samp>(da52d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6382](https://redirect.github.com/vitest-dev/vitest/issues/6382) [<samp>(fe489)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/fe489432) - Async assertion auto await should timeout - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6391](https://redirect.github.com/vitest-dev/vitest/issues/6391) [<samp>(ad6e7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6332](https://redirect.github.com/vitest-dev/vitest/issues/6332) [<samp>(1606f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1606f34f) - Improve inline snapshot inside loop rejection - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6339](https://redirect.github.com/vitest-dev/vitest/issues/6339) [<samp>(e0368)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6256](https://redirect.github.com/vitest-dev/vitest/issues/6256) [<samp>(153ff)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6393](https://redirect.github.com/vitest-dev/vitest/issues/6393) [<samp>(f6217)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f6217a22) - **ui**: - Remove "filters" flickering - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6463](https://redirect.github.com/vitest-dev/vitest/issues/6463) [<samp>(0223b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0223bb79) - Render project name consistently - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6329](https://redirect.github.com/vitest-dev/vitest/issues/6329) [<samp>(94a18)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6251](https://redirect.github.com/vitest-dev/vitest/issues/6251) [<samp>(c51c6)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c51c67aa) - Fix watch on vite 6 - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6422](https://redirect.github.com/vitest-dev/vitest/issues/6422) [<samp>(c3ac4)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3ac43c1) - **vitest**: - Update json reporter output - by [@​Emiyaaaaa](https://redirect.github.com/Emiyaaaaa) in [https://github.com/vitest-dev/vitest/issues/6064](https://redirect.github.com/vitest-dev/vitest/issues/6064) [<samp>(c9979)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c997937b) - Add more type guards for --merge-reports - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6307](https://redirect.github.com/vitest-dev/vitest/issues/6307) [<samp>(0a5d8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0a5d8169) - Always resolve vitest to the root version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6369](https://redirect.github.com/vitest-dev/vitest/issues/6369) [<samp>(163d7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/163d7624) - Dispose vmForks listeners to avoid memory leak - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6448](https://redirect.github.com/vitest-dev/vitest/issues/6448) [<samp>(2673c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6316](https://redirect.github.com/vitest-dev/vitest/issues/6316) [<samp>(afdcb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/afdcb8f2) ##### [View changes on GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) </details> --- ### 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 these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/antoinezanardi/werewolves-assistant-web-next). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
##### [v2.1.0](https://github.com/vitest-dev/vitest/releases/tag/v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://github.com/vitest-dev/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](https://github.com/sheremet-va) in vitest-dev/vitest#6355 [<samp>(874a1)</samp>](vitest-dev/vitest@874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6252 [<samp>(af2b8)</samp>](vitest-dev/vitest@af2b813c) - Make iframe scalable, improve documentation - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6257 [<samp>(74ca1)</samp>](vitest-dev/vitest@74ca11a4) - Introduce built-in locators - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6084 [<samp>(3347f)</samp>](vitest-dev/vitest@3347f83e) - Support v8 coverage - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6273 [<samp>(34199)</samp>](vitest-dev/vitest@34199bdf) - Support `userEvent.upload` in playwright provider - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6442 [<samp>(cf148)</samp>](vitest-dev/vitest@cf148645) - Support `--inspect` - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6433 [<samp>(0499a)</samp>](vitest-dev/vitest@0499a315) - Support `--inspect-brk` - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6434 [<samp>(7ab0f)</samp>](vitest-dev/vitest@7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@Ma-hawaj](https://github.com/Ma-hawaj) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6392 [<samp>(008f0)</samp>](vitest-dev/vitest@008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6309 [<samp>(5932a)</samp>](vitest-dev/vitest@5932a7f9) - **mocker**: - Introduce [@vitest/mocker](https://github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6289 [<samp>(95f02)</samp>](vitest-dev/vitest@95f0203f) - **vitest**: - Add "provide" option - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6253 [<samp>(4409d)</samp>](vitest-dev/vitest@4409d779) - Add return type and promisable mockFactory - by [@syi0808](https://github.com/syi0808) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6139 [<samp>(f5e0b)</samp>](vitest-dev/vitest@f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@bnjm](https://github.com/bnjm) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6347 [<samp>(8ff63)</samp>](vitest-dev/vitest@8ff63560) - Allow env to be stubbed to undefined - by [@JSanchezIO](https://github.com/JSanchezIO) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6359 [<samp>(c3b27)</samp>](vitest-dev/vitest@c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6266 [<samp>(081cf)</samp>](vitest-dev/vitest@081cfe03) - Don't panic when coverage.reporter is a string - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6267 [<samp>(7b37d)</samp>](vitest-dev/vitest@7b37d27b) - Align RawMatcherFn type definition with Jest - by [@wheresrhys](https://github.com/wheresrhys) in vitest-dev/vitest#6351 [<samp>(d09f0)</samp>](vitest-dev/vitest@d09f00c7) - Cjs build of vite node server - by [@AkaraChen](https://github.com/AkaraChen) in vitest-dev/vitest#6389 [<samp>(12e70)</samp>](vitest-dev/vitest@12e702bd) - Allow inlining vite's cached dependencies - by [@chriswheeldon-peakon](https://github.com/chriswheeldon-peakon) in vitest-dev/vitest#6284 [<samp>(03208)</samp>](vitest-dev/vitest@03208017) - Print unexpected error message if peer dependencies have a different version - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6446 [<samp>(b992b)</samp>](vitest-dev/vitest@b992b346) - Ignore importer when resolving Vitest - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6469 [<samp>(0b447)</samp>](vitest-dev/vitest@0b447226) - `expect.getState().testPath` always returns correct path - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6472 [<samp>(ac698)</samp>](vitest-dev/vitest@ac698b1c) - UserEvent works consistently between providers - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6480 [<samp>(0b4da)</samp>](vitest-dev/vitest@0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6134 [<samp>(1da6c)</samp>](vitest-dev/vitest@1da6cebe) - Use documentElement as the root for selector - by [@sheremet-va](https://github.com/sheremet-va) [<samp>(d8077)</samp>](vitest-dev/vitest@d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @vitest/browser/utils - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6296 [<samp>(30dc5)</samp>](vitest-dev/vitest@30dc5793) - Produce valid config file if preview provider is used - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6305 [<samp>(7f0ae)</samp>](vitest-dev/vitest@7f0ae292) - Correctly run in-source tests in the browser - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6440 [<samp>(c8531)</samp>](vitest-dev/vitest@c853126e) - Exclude missed packages from optimization, print help message - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6445 [<samp>(8d883)</samp>](vitest-dev/vitest@8d883cf0) - Define mocker as a dependency - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6476 [<samp>(9560a)</samp>](vitest-dev/vitest@9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6317 [<samp>(e662c)</samp>](vitest-dev/vitest@e662c7b2) - V8 to support source maps with multiple sources - by [@AriPerkkio](https://github.com/AriPerkkio) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6120 [<samp>(1f6cb)</samp>](vitest-dev/vitest@1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6318 [<samp>(91dea)</samp>](vitest-dev/vitest@91dea8c1) - Use project specific `vitenode` for uncovered files - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#6044 [<samp>(da52d)</samp>](vitest-dev/vitest@da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@LuciNyan](https://github.com/LuciNyan) in vitest-dev/vitest#6382 [<samp>(fe489)</samp>](vitest-dev/vitest@fe489432) - Async assertion auto await should timeout - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6391 [<samp>(ad6e7)</samp>](vitest-dev/vitest@ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6332 [<samp>(1606f)</samp>](vitest-dev/vitest@1606f34f) - Improve inline snapshot inside loop rejection - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6339 [<samp>(e0368)</samp>](vitest-dev/vitest@e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6256 [<samp>(153ff)</samp>](vitest-dev/vitest@153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@LuciNyan](https://github.com/LuciNyan) in vitest-dev/vitest#6393 [<samp>(f6217)</samp>](vitest-dev/vitest@f6217a22) - **ui**: - Remove "filters" flickering - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6463 [<samp>(0223b)</samp>](vitest-dev/vitest@0223bb79) - Render project name consistently - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6329 [<samp>(94a18)</samp>](vitest-dev/vitest@94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6251 [<samp>(c51c6)</samp>](vitest-dev/vitest@c51c67aa) - Fix watch on vite 6 - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#6422 [<samp>(c3ac4)</samp>](vitest-dev/vitest@c3ac43c1) - **vitest**: - Update json reporter output - by [@Emiyaaaaa](https://github.com/Emiyaaaaa) in vitest-dev/vitest#6064 [<samp>(c9979)</samp>](vitest-dev/vitest@c997937b) - Add more type guards for --merge-reports - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6307 [<samp>(0a5d8)</samp>](vitest-dev/vitest@0a5d8169) - Always resolve vitest to the root version - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6369 [<samp>(163d7)</samp>](vitest-dev/vitest@163d7624) - Dispose vmForks listeners to avoid memory leak - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6448 [<samp>(2673c)</samp>](vitest-dev/vitest@2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#6316 [<samp>(afdcb)</samp>](vitest-dev/vitest@afdcb8f2) ##### [View changes on GitHub](vitest-dev/vitest@v2.0.5...v2.1.0)
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-v8](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | [`^2.0.5` -> `^2.1.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [vitest](https://redirect.github.com/vitest-dev/vitest) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`^2.0.5` -> `^2.1.0`](https://renovatebot.com/diffs/npm/vitest/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v2.1.0`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v2.1.0) [Compare Source](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://redirect.github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://redirect.github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://redirect.github.com/vitest-dev/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](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6355](https://redirect.github.com/vitest-dev/vitest/issues/6355) [<samp>(874a1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6252](https://redirect.github.com/vitest-dev/vitest/issues/6252) [<samp>(af2b8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/af2b813c) - Make iframe scalable, improve documentation - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6257](https://redirect.github.com/vitest-dev/vitest/issues/6257) [<samp>(74ca1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/74ca11a4) - Introduce built-in locators - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6084](https://redirect.github.com/vitest-dev/vitest/issues/6084) [<samp>(3347f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/3347f83e) - Support v8 coverage - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6273](https://redirect.github.com/vitest-dev/vitest/issues/6273) [<samp>(34199)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/34199bdf) - Support `userEvent.upload` in playwright provider - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6442](https://redirect.github.com/vitest-dev/vitest/issues/6442) [<samp>(cf148)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/cf148645) - Support `--inspect` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6433](https://redirect.github.com/vitest-dev/vitest/issues/6433) [<samp>(0499a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0499a315) - Support `--inspect-brk` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6434](https://redirect.github.com/vitest-dev/vitest/issues/6434) [<samp>(7ab0f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@​Ma-hawaj](https://redirect.github.com/Ma-hawaj) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6392](https://redirect.github.com/vitest-dev/vitest/issues/6392) [<samp>(008f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6309](https://redirect.github.com/vitest-dev/vitest/issues/6309) [<samp>(5932a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/5932a7f9) - **mocker**: - Introduce [@​vitest/mocker](https://redirect.github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6289](https://redirect.github.com/vitest-dev/vitest/issues/6289) [<samp>(95f02)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/95f0203f) - **vitest**: - Add "provide" option - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6253](https://redirect.github.com/vitest-dev/vitest/issues/6253) [<samp>(4409d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/4409d779) - Add return type and promisable mockFactory - by [@​syi0808](https://redirect.github.com/syi0808) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6139](https://redirect.github.com/vitest-dev/vitest/issues/6139) [<samp>(f5e0b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@​bnjm](https://redirect.github.com/bnjm) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6347](https://redirect.github.com/vitest-dev/vitest/issues/6347) [<samp>(8ff63)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8ff63560) - Allow env to be stubbed to undefined - by [@​JSanchezIO](https://redirect.github.com/JSanchezIO) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6359](https://redirect.github.com/vitest-dev/vitest/issues/6359) [<samp>(c3b27)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6266](https://redirect.github.com/vitest-dev/vitest/issues/6266) [<samp>(081cf)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/081cfe03) - Don't panic when coverage.reporter is a string - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6267](https://redirect.github.com/vitest-dev/vitest/issues/6267) [<samp>(7b37d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7b37d27b) - Align RawMatcherFn type definition with Jest - by [@​wheresrhys](https://redirect.github.com/wheresrhys) in [https://github.com/vitest-dev/vitest/issues/6351](https://redirect.github.com/vitest-dev/vitest/issues/6351) [<samp>(d09f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d09f00c7) - Cjs build of vite node server - by [@​AkaraChen](https://redirect.github.com/AkaraChen) in [https://github.com/vitest-dev/vitest/issues/6389](https://redirect.github.com/vitest-dev/vitest/issues/6389) [<samp>(12e70)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/12e702bd) - Allow inlining vite's cached dependencies - by [@​chriswheeldon-peakon](https://redirect.github.com/chriswheeldon-peakon) in [https://github.com/vitest-dev/vitest/issues/6284](https://redirect.github.com/vitest-dev/vitest/issues/6284) [<samp>(03208)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/03208017) - Print unexpected error message if peer dependencies have a different version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6446](https://redirect.github.com/vitest-dev/vitest/issues/6446) [<samp>(b992b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/b992b346) - Ignore importer when resolving Vitest - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6469](https://redirect.github.com/vitest-dev/vitest/issues/6469) [<samp>(0b447)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b447226) - `expect.getState().testPath` always returns correct path - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6472](https://redirect.github.com/vitest-dev/vitest/issues/6472) [<samp>(ac698)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ac698b1c) - UserEvent works consistently between providers - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6480](https://redirect.github.com/vitest-dev/vitest/issues/6480) [<samp>(0b4da)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6134](https://redirect.github.com/vitest-dev/vitest/issues/6134) [<samp>(1da6c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1da6cebe) - Use documentElement as the root for selector - by [@​sheremet-va](https://redirect.github.com/sheremet-va) [<samp>(d8077)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @​vitest/browser/utils - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6296](https://redirect.github.com/vitest-dev/vitest/issues/6296) [<samp>(30dc5)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/30dc5793) - Produce valid config file if preview provider is used - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6305](https://redirect.github.com/vitest-dev/vitest/issues/6305) [<samp>(7f0ae)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7f0ae292) - Correctly run in-source tests in the browser - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6440](https://redirect.github.com/vitest-dev/vitest/issues/6440) [<samp>(c8531)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c853126e) - Exclude missed packages from optimization, print help message - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6445](https://redirect.github.com/vitest-dev/vitest/issues/6445) [<samp>(8d883)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8d883cf0) - Define mocker as a dependency - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6476](https://redirect.github.com/vitest-dev/vitest/issues/6476) [<samp>(9560a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6317](https://redirect.github.com/vitest-dev/vitest/issues/6317) [<samp>(e662c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e662c7b2) - V8 to support source maps with multiple sources - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6120](https://redirect.github.com/vitest-dev/vitest/issues/6120) [<samp>(1f6cb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6318](https://redirect.github.com/vitest-dev/vitest/issues/6318) [<samp>(91dea)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/91dea8c1) - Use project specific `vitenode` for uncovered files - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6044](https://redirect.github.com/vitest-dev/vitest/issues/6044) [<samp>(da52d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6382](https://redirect.github.com/vitest-dev/vitest/issues/6382) [<samp>(fe489)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/fe489432) - Async assertion auto await should timeout - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6391](https://redirect.github.com/vitest-dev/vitest/issues/6391) [<samp>(ad6e7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6332](https://redirect.github.com/vitest-dev/vitest/issues/6332) [<samp>(1606f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1606f34f) - Improve inline snapshot inside loop rejection - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6339](https://redirect.github.com/vitest-dev/vitest/issues/6339) [<samp>(e0368)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6256](https://redirect.github.com/vitest-dev/vitest/issues/6256) [<samp>(153ff)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6393](https://redirect.github.com/vitest-dev/vitest/issues/6393) [<samp>(f6217)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f6217a22) - **ui**: - Remove "filters" flickering - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6463](https://redirect.github.com/vitest-dev/vitest/issues/6463) [<samp>(0223b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0223bb79) - Render project name consistently - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6329](https://redirect.github.com/vitest-dev/vitest/issues/6329) [<samp>(94a18)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6251](https://redirect.github.com/vitest-dev/vitest/issues/6251) [<samp>(c51c6)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c51c67aa) - Fix watch on vite 6 - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6422](https://redirect.github.com/vitest-dev/vitest/issues/6422) [<samp>(c3ac4)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3ac43c1) - **vitest**: - Update json reporter output - by [@​Emiyaaaaa](https://redirect.github.com/Emiyaaaaa) in [https://github.com/vitest-dev/vitest/issues/6064](https://redirect.github.com/vitest-dev/vitest/issues/6064) [<samp>(c9979)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c997937b) - Add more type guards for --merge-reports - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6307](https://redirect.github.com/vitest-dev/vitest/issues/6307) [<samp>(0a5d8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0a5d8169) - Always resolve vitest to the root version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6369](https://redirect.github.com/vitest-dev/vitest/issues/6369) [<samp>(163d7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/163d7624) - Dispose vmForks listeners to avoid memory leak - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6448](https://redirect.github.com/vitest-dev/vitest/issues/6448) [<samp>(2673c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6316](https://redirect.github.com/vitest-dev/vitest/issues/6316) [<samp>(afdcb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/afdcb8f2) ##### [View changes on GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/ayushmanchhabra/vsx). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-v8](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@vitest%2fcoverage-v8/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-v8/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [vitest](https://redirect.github.com/vitest-dev/vitest) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`2.0.5` -> `2.1.0`](https://renovatebot.com/diffs/npm/vitest/2.0.5/2.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vitest/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/2.0.5/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v2.1.0`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v2.1.0) [Compare Source](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) This release makes another big change to the Browser Mode by introducing [locators API](https://vitest.dev/guide/browser/locators.html): ```ts 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](https://redirect.github.com/vitest-dev/vitest-browser-vue), [vitest-browser-svelte ](https://redirect.github.com/vitest-dev/vitest-browser-svelte) or [vitest-browser-react](https://redirect.github.com/vitest-dev/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](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6355](https://redirect.github.com/vitest-dev/vitest/issues/6355) [<samp>(874a1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/874a121e) - **browser**: - Move page.config to server.config, add more docs - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6252](https://redirect.github.com/vitest-dev/vitest/issues/6252) [<samp>(af2b8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/af2b813c) - Make iframe scalable, improve documentation - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6257](https://redirect.github.com/vitest-dev/vitest/issues/6257) [<samp>(74ca1)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/74ca11a4) - Introduce built-in locators - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6084](https://redirect.github.com/vitest-dev/vitest/issues/6084) [<samp>(3347f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/3347f83e) - Support v8 coverage - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6273](https://redirect.github.com/vitest-dev/vitest/issues/6273) [<samp>(34199)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/34199bdf) - Support `userEvent.upload` in playwright provider - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6442](https://redirect.github.com/vitest-dev/vitest/issues/6442) [<samp>(cf148)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/cf148645) - Support `--inspect` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6433](https://redirect.github.com/vitest-dev/vitest/issues/6433) [<samp>(0499a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0499a315) - Support `--inspect-brk` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6434](https://redirect.github.com/vitest-dev/vitest/issues/6434) [<samp>(7ab0f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7ab0f4a8) - **cli**: - Extend existing list command to output only a list of file names - by [@​Ma-hawaj](https://redirect.github.com/Ma-hawaj) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6392](https://redirect.github.com/vitest-dev/vitest/issues/6392) [<samp>(008f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/008f00b2) - **coverage**: - Add `--exclude-after-remap` - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6309](https://redirect.github.com/vitest-dev/vitest/issues/6309) [<samp>(5932a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/5932a7f9) - **mocker**: - Introduce [@​vitest/mocker](https://redirect.github.com/vitest/mocker) package, allow `{ spy: true }` instead of a factory - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6289](https://redirect.github.com/vitest-dev/vitest/issues/6289) [<samp>(95f02)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/95f0203f) - **vitest**: - Add "provide" option - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6253](https://redirect.github.com/vitest-dev/vitest/issues/6253) [<samp>(4409d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/4409d779) - Add return type and promisable mockFactory - by [@​syi0808](https://redirect.github.com/syi0808) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6139](https://redirect.github.com/vitest-dev/vitest/issues/6139) [<samp>(f5e0b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f5e0b987) - Add `vi.advanceTimersToNextFrame` - by [@​bnjm](https://redirect.github.com/bnjm) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6347](https://redirect.github.com/vitest-dev/vitest/issues/6347) [<samp>(8ff63)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8ff63560) - Allow env to be stubbed to undefined - by [@​JSanchezIO](https://redirect.github.com/JSanchezIO) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6359](https://redirect.github.com/vitest-dev/vitest/issues/6359) [<samp>(c3b27)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3b2757c) ##### 🐞 Bug Fixes - Correctly resolve nested mocks with `index` file - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6266](https://redirect.github.com/vitest-dev/vitest/issues/6266) [<samp>(081cf)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/081cfe03) - Don't panic when coverage.reporter is a string - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6267](https://redirect.github.com/vitest-dev/vitest/issues/6267) [<samp>(7b37d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7b37d27b) - Align RawMatcherFn type definition with Jest - by [@​wheresrhys](https://redirect.github.com/wheresrhys) in [https://github.com/vitest-dev/vitest/issues/6351](https://redirect.github.com/vitest-dev/vitest/issues/6351) [<samp>(d09f0)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d09f00c7) - Cjs build of vite node server - by [@​AkaraChen](https://redirect.github.com/AkaraChen) in [https://github.com/vitest-dev/vitest/issues/6389](https://redirect.github.com/vitest-dev/vitest/issues/6389) [<samp>(12e70)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/12e702bd) - Allow inlining vite's cached dependencies - by [@​chriswheeldon-peakon](https://redirect.github.com/chriswheeldon-peakon) in [https://github.com/vitest-dev/vitest/issues/6284](https://redirect.github.com/vitest-dev/vitest/issues/6284) [<samp>(03208)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/03208017) - Print unexpected error message if peer dependencies have a different version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6446](https://redirect.github.com/vitest-dev/vitest/issues/6446) [<samp>(b992b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/b992b346) - Ignore importer when resolving Vitest - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6469](https://redirect.github.com/vitest-dev/vitest/issues/6469) [<samp>(0b447)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b447226) - `expect.getState().testPath` always returns correct path - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6472](https://redirect.github.com/vitest-dev/vitest/issues/6472) [<samp>(ac698)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ac698b1c) - UserEvent works consistently between providers - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6480](https://redirect.github.com/vitest-dev/vitest/issues/6480) [<samp>(0b4da)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0b4da69e) - **browser**: - Print correct stack trace for unhandled errors - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6134](https://redirect.github.com/vitest-dev/vitest/issues/6134) [<samp>(1da6c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1da6cebe) - Use documentElement as the root for selector - by [@​sheremet-va](https://redirect.github.com/sheremet-va) [<samp>(d8077)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/d807767f) - Keep querying elements even if locator is created with elementLocator, add pubic @​vitest/browser/utils - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6296](https://redirect.github.com/vitest-dev/vitest/issues/6296) [<samp>(30dc5)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/30dc5793) - Produce valid config file if preview provider is used - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6305](https://redirect.github.com/vitest-dev/vitest/issues/6305) [<samp>(7f0ae)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/7f0ae292) - Correctly run in-source tests in the browser - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6440](https://redirect.github.com/vitest-dev/vitest/issues/6440) [<samp>(c8531)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c853126e) - Exclude missed packages from optimization, print help message - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6445](https://redirect.github.com/vitest-dev/vitest/issues/6445) [<samp>(8d883)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/8d883cf0) - Define mocker as a dependency - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6476](https://redirect.github.com/vitest-dev/vitest/issues/6476) [<samp>(9560a)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/9560ab7f) - **coverage**: - Warn if `vitest` and `@vitest/*` versions don't match - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6317](https://redirect.github.com/vitest-dev/vitest/issues/6317) [<samp>(e662c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e662c7b2) - V8 to support source maps with multiple sources - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) and [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6120](https://redirect.github.com/vitest-dev/vitest/issues/6120) [<samp>(1f6cb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1f6cb59f) - V8 to warn instead of crash when conversion fails - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6318](https://redirect.github.com/vitest-dev/vitest/issues/6318) [<samp>(91dea)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/91dea8c1) - Use project specific `vitenode` for uncovered files - by [@​AriPerkkio](https://redirect.github.com/AriPerkkio) in [https://github.com/vitest-dev/vitest/issues/6044](https://redirect.github.com/vitest-dev/vitest/issues/6044) [<samp>(da52d)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/da52d23f) - **runner**: - Use `performance.now` instead of `Date.now` for duration - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6382](https://redirect.github.com/vitest-dev/vitest/issues/6382) [<samp>(fe489)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/fe489432) - Async assertion auto await should timeout - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6391](https://redirect.github.com/vitest-dev/vitest/issues/6391) [<samp>(ad6e7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/ad6e72fc) - **snapshot**: - Reject multiple `toMatchInlineSnapshot` updates at the same location - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6332](https://redirect.github.com/vitest-dev/vitest/issues/6332) [<samp>(1606f)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/1606f34f) - Improve inline snapshot inside loop rejection - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6339](https://redirect.github.com/vitest-dev/vitest/issues/6339) [<samp>(e0368)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/e03683c5) - **typecheck**: - Run both runtime and typecheck tests if `typecheck.include` overlaps with `include` - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6256](https://redirect.github.com/vitest-dev/vitest/issues/6256) [<samp>(153ff)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/153ff01b) - **types**: - Allow Callbacks Passed to before\*/after\* to Return Anything - by [@​LuciNyan](https://redirect.github.com/LuciNyan) in [https://github.com/vitest-dev/vitest/issues/6393](https://redirect.github.com/vitest-dev/vitest/issues/6393) [<samp>(f6217)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/f6217a22) - **ui**: - Remove "filters" flickering - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6463](https://redirect.github.com/vitest-dev/vitest/issues/6463) [<samp>(0223b)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0223bb79) - Render project name consistently - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6329](https://redirect.github.com/vitest-dev/vitest/issues/6329) [<samp>(94a18)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/94a186ec) - **vite-node**: - Disable watcher if hmr is disabled - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6251](https://redirect.github.com/vitest-dev/vitest/issues/6251) [<samp>(c51c6)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c51c67aa) - Fix watch on vite 6 - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa) in [https://github.com/vitest-dev/vitest/issues/6422](https://redirect.github.com/vitest-dev/vitest/issues/6422) [<samp>(c3ac4)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c3ac43c1) - **vitest**: - Update json reporter output - by [@​Emiyaaaaa](https://redirect.github.com/Emiyaaaaa) in [https://github.com/vitest-dev/vitest/issues/6064](https://redirect.github.com/vitest-dev/vitest/issues/6064) [<samp>(c9979)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/c997937b) - Add more type guards for --merge-reports - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6307](https://redirect.github.com/vitest-dev/vitest/issues/6307) [<samp>(0a5d8)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/0a5d8169) - Always resolve vitest to the root version - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6369](https://redirect.github.com/vitest-dev/vitest/issues/6369) [<samp>(163d7)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/163d7624) - Dispose vmForks listeners to avoid memory leak - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6448](https://redirect.github.com/vitest-dev/vitest/issues/6448) [<samp>(2673c)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/2673c3bb) - **workspace**: - Correctly resolve workspace globs and file paths - by [@​sheremet-va](https://redirect.github.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/6316](https://redirect.github.com/vitest-dev/vitest/issues/6316) [<samp>(afdcb)</samp>](https://redirect.github.com/vitest-dev/vitest/commit/afdcb8f2) ##### [View changes on GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v2.0.5...v2.1.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/Johannes-Andersen/Johannes). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
Close: #6377
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.