-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add assertion helper to hide internal stack traces #9594
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
Merged
sheremet-va
merged 30 commits into
vitest-dev:main
from
hi-ogawa:02-05-feat_assertion_helper_to_filter_out_internal_stack_traces
Feb 7, 2026
Merged
feat: add assertion helper to hide internal stack traces #9594
sheremet-va
merged 30 commits into
vitest-dev:main
from
hi-ogawa:02-05-feat_assertion_helper_to_filter_out_internal_stack_traces
Feb 7, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ternal_stack_traces
This reverts commit 14dd475.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sheremet-va
requested changes
Feb 6, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ternal_stack_traces
Contributor
Author
|
The API is renamed to |
sheremet-va
approved these changes
Feb 7, 2026
Member
|
LGMT! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Resolves #4494
This PR implements
vi.defineHelper, which works like this:Example output:
The implementation relies on error stack error filtering based on special marker
function __VITEST_HELPER__. This processing happens duringparseStacktrace, so the filtering also applies to--printConsoleTrace(which I just realized and maybe we can tweak the behavior.)The error stack and
__VITEST_HELPER__filtering requires the original error to have proper trace. It turns out Webkit is a bit behind other runtimes, so currently "async" helper doesn't work. But, it looks like it's coming soon as Bun has it already WebKit/WebKit#57832 and this is also reached main line webkit oven-sh/bun#22517. We'll likely just need to wait for a few weeks until Playwright webkit update and see what happens.TODO
TBD
printConsoleTracealso hide helper internal?vi.defineHelperPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.