Skip to content

Commit 2bec365

Browse files
committed
tests: Add required context argument to locations where omitted.
This resolves a number of red squiggles in the tests for the `RemoteGraphQLDataSource` class since the `process` method on that class requires the `context` argument to be defined. These squiggles were correct, but our tests tolerate those type errors, it seems. (We should probably fix that, as I believe our tests should be strongly typed with few, clearly annotated exceptions.) cc @trevor-scheer @queerviolet as an FYI, since I'm slipping this small change in past PR review.
1 parent 131c9b8 commit 2bec365

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/apollo-gateway/src/datasources/__tests__/RemoteGraphQLDataSource.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe('willSendRequest', () => {
7272
query: '{ me { name } }',
7373
variables: { id: '1' },
7474
},
75+
context: {},
7576
});
7677

7778
expect(data).toEqual({ me: 'james' });
@@ -171,6 +172,7 @@ describe('error handling', () => {
171172

172173
const result = DataSource.process({
173174
request: { query: '{ me { name } }' },
175+
context: {},
174176
});
175177
await expect(result).rejects.toThrow(AuthenticationError);
176178
await expect(result).rejects.toMatchObject({
@@ -193,6 +195,7 @@ describe('error handling', () => {
193195

194196
const result = DataSource.process({
195197
request: { query: '{ me { name } }' },
198+
context: {},
196199
});
197200
await expect(result).rejects.toThrow(ForbiddenError);
198201
await expect(result).rejects.toMatchObject({
@@ -215,6 +218,7 @@ describe('error handling', () => {
215218

216219
const result = DataSource.process({
217220
request: { query: '{ me { name } }' },
221+
context: {},
218222
});
219223
await expect(result).rejects.toThrow(ApolloError);
220224
await expect(result).rejects.toMatchObject({
@@ -246,6 +250,7 @@ describe('error handling', () => {
246250

247251
const result = DataSource.process({
248252
request: { query: '{ me { name } }' },
253+
context: {},
249254
});
250255
await expect(result).rejects.toThrow(ApolloError);
251256
await expect(result).rejects.toMatchObject({

0 commit comments

Comments
 (0)