Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff highlights invalid differences #8834

Closed
umarashfaq opened this issue Aug 15, 2019 · 2 comments
Closed

diff highlights invalid differences #8834

umarashfaq opened this issue Aug 15, 2019 · 2 comments

Comments

@umarashfaq
Copy link

馃悰 Bug Report

When you're comparing two objects and you use expect.any(String) for some keys, and the test fails for some reason, diff highlights all those places where you used expect.any(String) which is very confusing.

To Reproduce

expect([
            {
                a: expect.any(String),
                b: '',
            },
            {
                c: expect.any(String),
            },
        ]).toEqual([
            {
                a: 'foo',
            },
            {
                c: 'bar',
            },
        ]);

Expected behavior

In case of a failure, diff should not highlight expect.any(String).

Link to repl or repo (highly encouraged)

Not available

Run npx envinfo --preset jest

System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Binaries:
    Node: 11.10.0 - ~/.nvm/versions/node/v11.10.0/bin/node
    Yarn: 1.15.2 - ~/src/accidentsint/node_modules/.bin/yarn
    npm: 6.7.0 - ~/.nvm/versions/node/v11.10.0/bin/npm
@jeysal
Copy link
Contributor

jeysal commented Aug 15, 2019

Duplicate of #6184. Unfortunately way harder to fix atm than it looks

@jeysal jeysal closed this as completed Aug 15, 2019
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants