MCPcopy
hub / github.com/graphql/graphql-js / expectToThrowJSON

Function expectToThrowJSON

src/__testUtils__/expectJSON.ts:50–62  ·  view source on GitHub ↗
(
  fn: () => unknown,
)

Source from the content-addressed store, hash-verified

48}
49
50export function expectToThrowJSON(
51 fn: () => unknown,
52): ReturnType<typeof expect> {
53 function mapException(): unknown {
54 try {
55 return fn();
56 } catch (error) {
57 throw toJSONDeep(error);
58 }
59 }
60
61 return expect(mapException).to.throw();
62}

Callers 5

expectSyntaxErrorFunction · 0.90
expectSyntaxErrorFunction · 0.90
expectSyntaxErrorFunction · 0.90
expectSyntaxErrorFunction · 0.90

Calls

no outgoing calls

Tested by 4

expectSyntaxErrorFunction · 0.72
expectSyntaxErrorFunction · 0.72
expectSyntaxErrorFunction · 0.72
expectSyntaxErrorFunction · 0.72