-
-
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
pretty-format does not support Immutable.Record #3677
Comments
Hey! Would you like to implement it? It should be straight forward once you see how other Immutable entities are written. You'll find the code in plugins directory of pretty-format :) |
I started to work on it. Is this format ok? const ABRecord = Immutable.Record({a: 1, b: 2}, 'ABRecord');
prettyPrint(new ABRecord());
// => Immutable.Record(ABRecord) {a: 1, b: 2}
const CDRecord = Immutable.Record({c: 1, d: 2});
prettyPrint(new CDRecord());
// => Immutable.Record {c: 1, d: 2} |
Looks good to me. const ABRecord = Immutable.Record({a: 1, b: 2}, 'ABRecord');
prettyPrint(new ABRecord());
// => Immutable.Record "ABRecord" {a: 1, b: 2}
// or
// => Immutable.Record["ABRecord"] {a: 1, b: 2} How about this? Also I just checked out how it looks in const ABRecord = Immutable.Record({a: 1, b: 2}, 'ABRecord');
prettyPrint(new ABRecord());
// => Immutable.ABRecord {a: 1, b: 2} Pick whatever makes more sense to you. |
If you are fine with |
* Add support for Immutable.Record in pretty-format Fixes #3677 * Extract pushToImmutableArray function
* Add support for Immutable.Record in pretty-format Fixes jestjs#3677 * Extract pushToImmutableArray function
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. |
Do you want to request a feature or report a bug?
This is a feature
What is the current behavior?
What is the expected behavior?
prettyFormat
should return something other than anObject
, probablyImmutable.Record
to be consistent with other Immutable structures.Use case: I use records in various places of my Redux state (the state being a record itself) and I am using snapshots to test my reducers. I would really like the state to not be serialized as JSON (mostly because this makes the
Map
&List
it contain appear as plain JS objects).Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
pretty-format v20.0.3
immutable.js v3.8.1
Node 7.10.0
MacOS 10.12.5
The text was updated successfully, but these errors were encountered: