Skip to content

BUG: nested matcher printing "object Object" #682

Open
@leppaott

Description

@leppaott

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]>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions