Closed as not planned
Description
🐛 Bug Report
Per the docs https://jestjs.io/docs/en/expect#expectobjectcontainingobject, the following minimal assertion is expected to pass
describe("objectContaining", () => {
it("should work", () => {
const headers = new Headers({});
headers.set("weee", "weee");
expect({
a: "a",
headers,
b: {
c: new Map(),
d: "awfiotnaf",
},
}).toEqual(
expect.objectContaining({
b: {
d: expect.any(String),
},
})
);
});
});
.toEqual
seems suspicious, but peers in the community have asserted that because of the subset language, the above should still. take.
To Reproduce
pnpx jest
Link to repl or repo (highly encouraged)
https://github.com/cdaringe/jest-object-containing
envinfo
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm