Closed ValeriaVG closed 3 years ago
The following tests are now passing:
it("toMatchObject/arrays", () => { expect([]).toMatchObject([]); expect([]).not.toMatchObject({}); expect([1, 2, 3]).toMatchObject([1, 2]); expect([2, 3]).not.toMatchObject([1, 2, 3]); expect([{ id: 1, name: "1" }, { id: 2, name: "2" }, { id: 3 }]).toMatchObject( [{ id: 1 }, { id: 2 }, { id: 3 }] ); expect([{ id: 1 }, { id: 2 }, { id: 3 }]).not.toMatchObject([ { id: 1, name: "1" }, { id: 2, name: "2" }, { id: 3 }, ]); expect({ a: [1, 2, 3] }).toMatchObject({ a: [1, 2, 3] }); expect({ a: [1, 2] }).not.toMatchObject({ a: [1, 2, 3] }); });
The following tests are now passing: