-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(utils): support diff.printBasicPrototype
, Adding possibility to get rid of prototypes from the output
#6504
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should definitely be the same as the default now (disabled)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.