-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Feature request: allow hook for overriding serialize function in jest-snapshot #1741
Comments
Just tested |
You can overwrite Try:
|
@cpojer Mind if I make a PR for specifying packages that would export objects that conform to pretty-format plugin interface?
Usage
|
yeah I'd be happy to accept that! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have a custom component implementation based on incremental-dom and I wish to do snapshot testing for it.
I've checked the source code of
jest
and from what I've figured, it is as easy as replacingserialize
function injest-snapshot/src/SnapshotFile.js
, which converts a given data to a string against which comparison/matching is done. In React's case,serialize
takes a jsonized react component and it returns it after piping it through pretty-format.I will fork jest for now; but it would save me maintaining the fork if this feature was implemented.
The text was updated successfully, but these errors were encountered: