Skip to content

Commit 036d83f

Browse files
committed
correct message
1 parent 5d4979c commit 036d83f

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

examples/nextjs-legacy-pages/__integration-tests__/nextjs-legacy.spec.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,9 @@ describe('NextJS Legacy Pages', () => {
3535
...Object.fromEntries(response.headers.entries()),
3636
date: null,
3737
'keep-alive': null,
38-
}).toMatchInlineSnapshot(`
39-
{
40-
"connection": "close",
41-
"content-length": "79",
42-
"content-type": "application/json; charset=utf-8",
43-
"date": null,
44-
"keep-alive": null,
45-
"vary": "Accept-Encoding",
46-
}
47-
`);
38+
}).toMatchObject({
39+
'content-type': 'application/json; charset=utf-8',
40+
});
4841

4942
const json = await response.json();
5043

packages/graphql-yoga/__tests__/request-cancellation.spec.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ describe('request cancellation', () => {
44
it('request cancellation stops invocation of subsequent resolvers', async () => {
55
const rootResolverGotInvokedD = createDeferred();
66
const requestGotCancelledD = createDeferred();
7-
87
let aResolverGotInvoked = false;
98
let rootResolverGotInvoked = false;
10-
119
const schema = createSchema({
1210
typeDefs: /* GraphQL */ `
1311
type Query {
1412
root: A!
1513
}
16-
1714
type A {
1815
a: String!
1916
}
@@ -24,7 +21,6 @@ describe('request cancellation', () => {
2421
rootResolverGotInvoked = true;
2522
rootResolverGotInvokedD.resolve();
2623
await requestGotCancelledD.promise;
27-
2824
return { a: 'a' };
2925
},
3026
},
@@ -36,9 +32,7 @@ describe('request cancellation', () => {
3632
},
3733
},
3834
});
39-
4035
const yoga = createYoga({ schema });
41-
4236
const abortController = new AbortController();
4337
const promise = Promise.resolve(
4438
yoga.fetch('http://yoga/graphql', {
@@ -50,16 +44,13 @@ describe('request cancellation', () => {
5044
signal: abortController.signal,
5145
}),
5246
);
53-
5447
await rootResolverGotInvokedD.promise;
5548
abortController.abort();
56-
5749
requestGotCancelledD.resolve();
58-
59-
await expect(promise).rejects.toThrow('Aborted');
60-
50+
await expect(promise).rejects.toThrow('This operation was aborted');
6151
expect(rootResolverGotInvoked).toBe(true);
6252
expect(aResolverGotInvoked).toBe(false);
53+
await requestGotCancelledD.promise;
6354
});
6455
});
6556

0 commit comments

Comments
 (0)