-
Notifications
You must be signed in to change notification settings - Fork 177
use stable stringify for better objects diff #573
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
Conversation
|
This won't work with a circular object. |
|
what do you mean by 'this won't work'? It should act the same as before (all tests have passed) |
|
My bad, I thought json-stringify-safe was more clever than it really is. |
|
Yes, it just outputs |
lib/reporters/console.js
Outdated
|
|
||
| internals.stringify = (obj, serializer, indent, decycler) => { | ||
|
|
||
| return StableStringify( |
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.
Can't we just do StableStringify(obj, { space: indent, replacer: StringifySafe.getSerialize(serializer) }) ?
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.
yes, we can 👍
I changed it
|
I would maybe recommend "fast-safe-stringify" as an alternative since I think it's the fastest one out that that doesn't crash on circular references. |
|
@iamdoron well done, this will be a nice improvement for our console reporter. |
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
instead of:
