Skip to content

Commit f059941

Browse files
committed
test returning nothing
1 parent 1f35fee commit f059941

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/__tests__/handler.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -336,27 +336,22 @@ it('should report thrown GraphQLError from custom request params parser', async
336336
`);
337337
});
338338

339-
it('should report thrown GraphQLError from custom request params parser', async () => {
339+
it('should use the default if nothing is returned from the custom request params parser', async () => {
340340
const server = startTServer({
341341
parseRequestParams() {
342-
throw new GraphQLError('Wronger.');
342+
return;
343343
},
344344
});
345345

346346
const url = new URL(server.url);
347-
url.searchParams.set('query', '{ __typename }');
348-
const res = await fetch(url.toString(), {
349-
headers: { accept: 'application/json' },
350-
});
347+
url.searchParams.set('query', '{ hello }');
348+
const res = await fetch(url.toString());
351349

352-
expect(res.status).toBe(200);
353350
await expect(res.json()).resolves.toMatchInlineSnapshot(`
354351
{
355-
"errors": [
356-
{
357-
"message": "Wronger.",
358-
},
359-
],
352+
"data": {
353+
"hello": "world",
354+
},
360355
}
361356
`);
362357
});

0 commit comments

Comments
 (0)