[Snyk] Upgrade vitest from 2.1.0 to 2.1.1 #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade vitest from 2.1.0 to 2.1.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 1 version ahead of your current version.
The recommended version was released on 22 days ago.
Release notes
Package name: vitest
-
2.1.1 - 2024-09-13
- browser:
- Make example test callbacks async - by @ aqandrew in #6484 (16aa7)
- Optimize vitest-browser-vue correctly - by @ sheremet-va in #6490 (5cbb0)
- workspace:
- Resolve glob pattern once to avoid name collision - by @ sheremet-va in #6489 (36b5a)
-
2.1.0 - 2024-09-12
test('renders blog posts', async () => {
- workspace:
- Correctly resolve workspace globs and file paths - by @ sheremet-va in #6316 (afdcb)
- This changes how the custom glob pattern in the workspace config is treated. Any file matching the glob is considered a Vitest config file. Any folder matching the glob pattern is treated as a workspace project and is subject to the regular config resolution (single
- For example,
- This change doesn't affect non-glob usage.
- api:
- Make spec into a class instead of a tuple - by @ sheremet-va in #6355 (874a1)
- browser:
- Move page.config to server.config, add more docs - by @ sheremet-va in #6252 (af2b8)
- Make iframe scalable, improve documentation - by @ sheremet-va in #6257 (74ca1)
- Introduce built-in locators - by @ sheremet-va in #6084 (3347f)
- Support v8 coverage - by @ AriPerkkio in #6273 (34199)
- Support
- Support
- Support
- cli:
- Extend existing list command to output only a list of file names - by @ Ma-hawaj and @ sheremet-va in #6392 (008f0)
- coverage:
- Add
- mocker:
- Introduce @ vitest/mocker package, allow
- vitest:
- Add "provide" option - by @ sheremet-va in #6253 (4409d)
- Add return type and promisable mockFactory - by @ syi0808 and @ sheremet-va in #6139 (f5e0b)
- Add
- Allow env to be stubbed to undefined - by @ JSanchezIO and @ sheremet-va in #6359 (c3b27)
- Migrate from
- Correctly resolve nested mocks with
- Don't panic when coverage.reporter is a string - by @ sheremet-va in #6267 (7b37d)
- Align RawMatcherFn type definition with Jest - by @ wheresrhys in #6351 (d09f0)
- Cjs build of vite node server - by @ AkaraChen in #6389 (12e70)
- Allow inlining vite's cached dependencies - by @ chriswheeldon-peakon in #6284 (03208)
- Print unexpected error message if peer dependencies have a different version - by @ sheremet-va in #6446 (b992b)
- Ignore importer when resolving Vitest - by @ sheremet-va in #6469 (0b447)
- UserEvent works consistently between providers - by @ sheremet-va in #6480 (0b4da)
- browser:
- Print correct stack trace for unhandled errors - by @ sheremet-va in #6134 (1da6c)
- Use documentElement as the root for selector - by @ sheremet-va (d8077)
- Keep querying elements even if locator is created with elementLocator, add pubic @ vitest/browser/utils - by @ sheremet-va in #6296 (30dc5)
- Produce valid config file if preview provider is used - by @ sheremet-va in #6305 (7f0ae)
- Correctly run in-source tests in the browser - by @ sheremet-va in #6440 (c8531)
- Exclude missed packages from optimization, print help message - by @ sheremet-va in #6445 (8d883)
- Define mocker as a dependency - by @ sheremet-va in #6476 (9560a)
- coverage:
- Warn if
- V8 to support source maps with multiple sources - by @ AriPerkkio and @ sheremet-va in #6120 (1f6cb)
- V8 to warn instead of crash when conversion fails - by @ AriPerkkio in #6318 (91dea)
- Use project specific
- runner:
- Use
- Async assertion auto await should timeout - by @ hi-ogawa in #6391 (ad6e7)
- snapshot:
- Reject multiple
- Improve inline snapshot inside loop rejection - by @ hi-ogawa in #6339 (e0368)
- typecheck:
- Run both runtime and typecheck tests if
- types:
- Allow Callbacks Passed to before*/after* to Return Anything - by @ LuciNyan in #6393 (f6217)
- ui:
- Remove "filters" flickering - by @ sheremet-va in #6463 (0223b)
- Render project name consistently - by @ sheremet-va in #6329 (94a18)
- vite-node:
- Disable watcher if hmr is disabled - by @ sheremet-va in #6251 (c51c6)
- Fix watch on vite 6 - by @ hi-ogawa in #6422 (c3ac4)
- vitest:
- Update json reporter output - by @ Emiyaaaaa in #6064 (c9979)
- Add more type guards for --merge-reports - by @ sheremet-va in #6307 (0a5d8)
- Always resolve vitest to the root version - by @ sheremet-va in #6369 (163d7)
- Dispose vmForks listeners to avoid memory leak - by @ sheremet-va in #6448 (2673c)
from vitest GitHub release notes🐞 Bug Fixes
View changes on GitHub
This release makes another big change to the Browser Mode by introducing locators API:
const screen = page.render(<Blog />)
await expect.element(screen.getByRole('heading', { name: 'Blog' })).toBeInTheDocument()
const [firstPost] = screen.getByRole('listitem').all()
await firstPost.getByRole('button', { name: 'Delete' }).click()
expect(screen.getByRole('listitem').all()).toHaveLength(3)
})
You can use either vitest-browser-vue, vitest-browser-svelte or vitest-browser-react to render components and make assertions using locators. Locators are also available on the
pageobject from@ vitest/browser/context.Potential Breaking Change
vitest.config.tsorvite.config.tsinside the folder)projects/*will match anything inside theprojectsfolder. If it's a folder, we try to find the config inside that folder (if there is none, it is still treated as a project with the default config). If it's a file, it will be treated as a Vitest config.projects/**/*previously would assume that you only wanted to have folders as projects, but now it will match every single file insideprojects.🚀 Features
userEvent.uploadin playwright provider - by @ sheremet-va in #6442 (cf148)--inspect- by @ AriPerkkio in #6433 (0499a)--inspect-brk- by @ AriPerkkio in #6434 (7ab0f)--exclude-after-remap- by @ AriPerkkio in #6309 (5932a){ spy: true }instead of a factory - by @ sheremet-va in #6289 (95f02)vi.advanceTimersToNextFrame- by @ bnjm and @ sheremet-va in #6347 (8ff63)fast-globtotinyglobby- by @ SuperchupuDev in #6274 (c321a)🐞 Bug Fixes
indexfile - by @ sheremet-va in #6266 (081cf)expect.getState().testPathalways returns correct path - by @ sheremet-va in #6472 (ac698)vitestand@ vitest/*versions don't match - by @ AriPerkkio in #6317 (e662c)vitenodefor uncovered files - by @ AriPerkkio in #6044 (da52d)performance.nowinstead ofDate.nowfor duration - by @ LuciNyan in #6382 (fe489)toMatchInlineSnapshotupdates at the same location - by @ hi-ogawa in #6332 (1606f)typecheck.includeoverlaps withinclude- by @ sheremet-va in #6256 (153ff)View changes on GitHub
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: