8000 Disable `toJSON` in pretty-format it diff is identical. · Issue #1728 · jestjs/jest · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Disable toJSON in pretty-format it diff is identical. #1728
Closed
@cpojer

Description

@cpojer

When comparing two values using toEqual, quite often they can look equal and produce the No visible difference message even though they are completely different objects.

Example:

expect({a: 1, toJSON: () => 'foo'}).toEqual({a: 2, toJSON: () => 'foo'});

this will produce "No visible difference". When this happens, we should run pretty-format again with toJSON calls disabled and then print an initial message that says we are printing the internal object structure (or something) and then diff that.

See #1727

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0