feat(utils): support diff.printBasicPrototype, Adding possibility to get rid of prototypes from the output#6504
feat(utils): support diff.printBasicPrototype, Adding possibility to get rid of prototypes from the output#6504spamshaker wants to merge 12 commits intovitest-dev:mainfrom
diff.printBasicPrototype, Adding possibility to get rid of prototypes from the output#6504Conversation
Adding possibility to get rid of printing prototype in diff output
Added a new configuration option `printBasicPrototype` to the diff section. This allows users to set the pretty-format option for the diff output, with a default value of `true`.
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
| #### diff.printBasicPrototype | ||
|
|
||
| - **Type**: `boolean` | ||
| - **Default**: `true` | ||
|
|
||
| Allows to set pretty-format option printBasicPrototype for diff output |
There was a problem hiding this comment.
Isn't it already default false on Vitest? https://vitest.dev/guide/snapshot.html#_2-printbasicprototype-is-default-to-false
There was a problem hiding this comment.
Aha, I just notice these two diff.printBasicPrototype and snapshotFormat.printBasicPrototype are different things. I think adding this option is okay to start with, but I wonder if we should have these two same as default.
Btw, can you add a test?
There was a problem hiding this comment.
It should definitely be the same as the default now (disabled)
There was a problem hiding this comment.
take a look and tell me what will be the result of this evaluation?
https://github.com/vitest-dev/vitest/blob/main/packages/pretty-format/src/index.ts#L491
So I am not changing the default but adding missing possibility to set it from main config
If this should be default behavior (disabled) the code I pointed must be changed
There was a problem hiding this comment.
take a look and tell me what will be the result of this evaluation?
Adding tests will hopefully tell you that 😃
Btw, changing the default will probably break a few our internal diff test. If you like, you can just add option in this PR and we can follow up changing the default separately.
diff.printBasicPrototype, Adding possibility to get rid of prototypes from the output
Update index.ts Adding possibility to get rid of printing prototype in diff output Update types.ts Update config documentation to include diff.printBasicPrototype Added a new configuration option `printBasicPrototype` to the diff section. This allows users to set the pretty-format option for the diff output, with a default value of `true`. Update index.ts CR Fixes test: add test chore: type error chore: lint test: fix threshold test chore: lint
|
Closing this PR as I merged your commits into #6740 and fixed conflicts early. Thanks for the contribution! |
Description
simplifies copying output to apply result in unit test
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:.