MCPcopy
hub / github.com/ardatan/graphql-tools / expectJSON

Function expectJSON

packages/executor/src/__testUtils__/expectJSON.ts:43–56  ·  view source on GitHub ↗
(actual: unknown)

Source from the content-addressed store, hash-verified

41}
42
43export function expectJSON(actual: unknown) {
44 const actualJSON = toJSONDeep(actual);
45
46 return {
47 toDeepEqual(expected: unknown) {
48 const expectedJSON = toJSONDeep(expected);
49 expect(actualJSON).toMatchObject(expectedJSON as any);
50 },
51 toDeepNestedProperty(path: string, expected: unknown) {
52 const expectedJSON = toJSONDeep(expected);
53 expect(actualJSON).toHaveProperty(path, expectedJSON);
54 },
55 };
56}
57
58export function expectToThrowJSON(fn: () => unknown) {
59 function mapException(): unknown {

Callers 15

expectMatchingValuesFunction · 0.85
lists-test.tsFile · 0.85
completeFunction · 0.85
sync-test.tsFile · 0.85
executeQueryFunction · 0.85
abstract-test.tsFile · 0.85
toEqualFunction · 0.85
executeSyncAndAsyncFunction · 0.85
nonnull-test.tsFile · 0.85
executor-test.tsFile · 0.85
variables-test.tsFile · 0.85
subscribe.test.tsFile · 0.85

Calls 1

toJSONDeepFunction · 0.85

Tested by 4

completeFunction · 0.68
executeQueryFunction · 0.68
toEqualFunction · 0.68
executeSyncAndAsyncFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…