Skip to content

Commit 81bbeec

Browse files
committed
check mock call
1 parent f636303 commit 81bbeec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/__tests__/handler.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ it('should print plain errors in detail', async () => {
190190
});
191191

192192
it('should format errors using the formatter', async () => {
193-
const formatErrorFn = jest.fn(() => new Error('Formatted'));
193+
const formatErrorFn = jest.fn((_err) => new Error('Formatted'));
194194
const server = startTServer({
195195
formatError: formatErrorFn,
196196
});
@@ -207,4 +207,7 @@ it('should format errors using the formatter', async () => {
207207
}
208208
`);
209209
expect(formatErrorFn).toBeCalledTimes(1);
210+
expect(formatErrorFn.mock.lastCall?.[0]).toMatchInlineSnapshot(
211+
`[GraphQLError: Cannot query field "idontexist" on type "Query".]`,
212+
);
210213
});

0 commit comments

Comments
 (0)