Skip to content

fix(snapshot): export custom snapshot matcher helper from vitest#10042

Merged
sheremet-va merged 13 commits intovitest-dev:mainfrom
hi-ogawa:fix-export-custom-snapshot-matcher-helper-from-vitest
Apr 4, 2026
Merged

fix(snapshot): export custom snapshot matcher helper from vitest#10042
sheremet-va merged 13 commits intovitest-dev:mainfrom
hi-ogawa:fix-export-custom-snapshot-matcher-helper-from-vitest

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Apr 2, 2026

Description

Moving helpers from vitest/runtime to vitest so that they can be used for browser mode.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3f4eeb2
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/69cf15f0c02c3b0008553322
😎 Deploy Preview https://deploy-preview-10042--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hi-ogawa hi-ogawa marked this pull request as ready for review April 2, 2026 06:37
@hi-ogawa hi-ogawa changed the title fix: export custom snapshot matcher helper from vitest fix(snapshot): export custom snapshot matcher helper from vitest Apr 2, 2026
Co-authored-by: Codex <noreply@openai.com>
@hi-ogawa
Copy link
Copy Markdown
Collaborator Author

hi-ogawa commented Apr 2, 2026

Shoot. Windows CI is dead. Fixing.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@10042

@vitest/browser-playwright

npm i https://pkg.pr.new/@vitest/browser-playwright@10042

@vitest/browser-preview

npm i https://pkg.pr.new/@vitest/browser-preview@10042

@vitest/browser-webdriverio

npm i https://pkg.pr.new/@vitest/browser-webdriverio@10042

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@10042

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@10042

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@10042

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@10042

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@10042

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@10042

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@10042

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@10042

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@10042

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@10042

vitest

npm i https://pkg.pr.new/vitest@10042

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@10042

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@10042

commit: f9fc7bc

@sheremet-va sheremet-va requested a review from AriPerkkio April 2, 2026 17:31

::: tip
To build custom **snapshot matchers** (wrappers around `toMatchSnapshot` / `toMatchInlineSnapshot` / `toMatchFileSnapshot`), use the composable functions from `vitest/runtime`. See [Custom Snapshot Matchers](/guide/snapshot#custom-snapshot-matchers).
To build custom **snapshot matchers** (wrappers around `toMatchSnapshot()` / `toMatchInlineSnapshot()` / `toMatchFileSnapshot()`), use `SnapshotMatchers` from `vitest`. See [Custom Snapshot Matchers](/guide/snapshot#custom-snapshot-matchers).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I said the name is ok, but what do you think about a more generic Snapshots? SnapshotMatchers just seems to specific for a namespace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, Snapshots namespace would allow adding non-matcher specific stuff here too in future.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Updated 👍

hi-ogawa and others added 4 commits April 3, 2026 10:12
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@sheremet-va sheremet-va merged commit 691d341 into vitest-dev:main Apr 4, 2026
17 checks passed
@hi-ogawa hi-ogawa deleted the fix-export-custom-snapshot-matcher-helper-from-vitest branch April 4, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants