-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject-containing-map.test.ts
47 lines (42 loc) · 1.26 KB
/
object-containing-map.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
it("SHOULD PASS should match an object containing an identical Map", () => {
expect({ aMap: new Map([[1, 1]]) }).toEqual(
expect.objectContaining({
aMap: new Map([[1, 1]]),
})
);
});
it("SHOULD FAIL should report an error on this one but it does not", () => {
expect({ aMap: new Map([[1, 1]]) }).toEqual(
expect.objectContaining({
aMap: new Map([[2, 2]]),
})
);
});
it("SHOULD PASS should not match an object containing a Map with different entries", () => {
expect({ aMap: new Map([[1, 1]]) }).toEqual(
expect.not.objectContaining({
aMap: new Map([[2, 2]]),
})
);
});
it("SHOULD PASS should not equal an object containing a Map with different entries", () => {
expect({ aMap: new Map([[1, 1]]) }).not.toEqual(
expect.objectContaining({
aMap: new Map([[2, 2]]),
})
);
});
it("SHOULD FAIL should not match an object containing a Map with different entries", () => {
expect({ aMap: new Map([[1, 1]]) }).toEqual(
expect.not.objectContaining({
aMap: new Map([[1, 1]]),
})
);
});
it("SHOULD FAIL should not equal an object containing a Map with different entries", () => {
expect({ aMap: new Map([[1, 1]]) }).not.toEqual(
expect.objectContaining({
aMap: new Map([[1, 1]]),
})
);
});