docs: document pretty-format and its usage across Vitest + add unit tests#10052
Conversation
Co-authored-by: Codex <noreply@openai.com>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
|
|
||
| [GitHub](https://github.com/vitest-dev/vitest/tree/main/packages/pretty-format) | [Documentation](https://vitest.dev/) | ||
|
|
||
| ## Usage |
There was a problem hiding this comment.
I'd like to keep readme to a minimum to reduce the size in node_modules. Let's follow the same logic we did for the mocker package (define usage in a separate .md file)
There was a problem hiding this comment.
I don't mind moving this but that reasoning means you don't want excessive jsdoc in code too. What's the boundary?
(for example, should jsdoc also minimized and better to just link to vitest.dev?)
There was a problem hiding this comment.
What's the boundary?
The boundary is README. Jsdoc is at least visible in the code editors
| - `escapeRegex: true` | ||
| - `printFunctionName: false` | ||
|
|
||
| Default snapshot plugin stack: |
There was a problem hiding this comment.
Hi @hi-ogawa
I've seen you replies to my comment on commit: d562712#diff-66d9a6908a960275eb01c353475a4710c986b99fa3caf5cfe90f976ac5d69824R122
For some reason, the current GitHub UI doesn't let me see your comment 😅
Could you please repost it here so that I can check it?
There was a problem hiding this comment.
(Ok, repeating here 😃)
I'm trying to migrate from Jest to Vitest and this different behavior from Jest/Vitest regarding Error Cause snapshot is a bit annoying.
@slorber I think timeline wise, there wasn't ErrorPlugin in jest and Vitest just added on its own only for diff diagnostic improvement so far. We have been avoiding snapshot breaking change by not adding it as snapshot serializer yet (and/or mostly forgotten since there was never request). Can you create an issue to explain what's different now?
Description
@vitest/pretty-format#10050Test cases are copied from #9609
Please 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:.