-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Amend jest snapshots to tie in nicely with Ava #2130
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Current coverage is 88.32% (diff: 100%)@@ master #2130 diff @@
==========================================
Files 38 38
Lines 1371 1371
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 1211 1211
Misses 160 160
Partials 0 0
|
Hey! Thanks for this. I'll be out on vacation next week but happy to look after then. |
() => matcherHint('.toMatchSnapshot', 'value', '') + '\n\n' + | ||
`${RECEIVED_COLOR('Received value')} does not match ` + | ||
const report = | ||
() => `${RECEIVED_COLOR('Received value')} does not match ` + |
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.
I'm not quite sure how to handle this particular bit. Report is very similar to the message - message only has one more line at the beginning that is implementation-specific.
I'm also confused that message is either a function or a string, depending on whether the test was successful or not.
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.
We are going to change the interface for message
to always be a function.
Thanks @cpojer, looking forward to your feedback :) Happy Thanksgiving! |
I'm not super excited about the |
Thank you @cpojer ! |
I'll publish a new version of Jest sometime this week once I get through all of these issues. Sorry for making you wait. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
I am currently working on implementation of jest snapshots into Ava (avajs/ava#1113) and wanted to smooth a few rough edges when implementing with another runner.
In particular:
dontThrow
function - that however depends too much on the implementationexpect(value).toMatchSnapshot()
- which again displays an implementation detail that isn't necessaryI'm happy to change the solution but it would be great to address these issues.
Test plan
When integrated with Ava, we get this kind of output:
(Amazingly, when combined with
nyc
for test coverage, it works seamlessly without any additional work!)