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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: nested matcher printing "object Object" #682

Open
leppaott opened this issue Mar 26, 2024 · 0 comments
Open

BUG: nested matcher printing "object Object" #682

leppaott opened this issue Mar 26, 2024 · 0 comments

Comments

@leppaott
Copy link

This works:

 expect(items).toIncludeSameMembers([
        expect.objectContaining({....
        }),
        expect.objectContaining({...
        })
      ]);

Output:

  Expected list to have the following members and no more:
      [ObjectContaining {data for expected......}]

However

 expect(items).toEqual(
        expect.toIncludeSameMembers([
          expect.objectContaining({...
          }),
          expect.objectContaining({...
          })
        ])

Output:

 Expected: toIncludeSameMembers<ObjectContaining,ObjectContaining>

So removing the objectContaining and using just plain objects there with data we get:

Expected: toIncludeSameMembers<[object Object],[object Object]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant