We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01dfa68 commit cbbff7fCopy full SHA for cbbff7f
src/__testUtils__/expectJSON.ts
@@ -24,15 +24,16 @@ function toJSONDeep(value: unknown): unknown {
24
}
25
26
export function expectJSON(actual: unknown) {
27
+ const actualJSON = toJSONDeep(actual);
28
+
29
return {
30
toDeepEqual(expected: unknown) {
- expect(toJSONDeep(actual)).to.deep.equal(toJSONDeep(expected));
31
+ const expectedJSON = toJSONDeep(expected);
32
+ expect(actualJSON).to.deep.equal(expectedJSON);
33
},
34
toDeepNestedProperty(path: string, expected: unknown) {
- expect(toJSONDeep(actual)).to.deep.nested.property(
- path,
- toJSONDeep(expected),
35
- );
36
+ expect(actualJSON).to.deep.nested.property(path, expectedJSON);
37
38
};
39
0 commit comments