Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 194b842

Browse files
danielreardenIvanGoncharov
authored andcommitted
Fix middleware thunk test
1 parent fb6f844 commit 194b842

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/__tests__/http-test.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,26 +1110,22 @@ function runTests(server: Server) {
11101110
it('will send request and response when using thunk', async () => {
11111111
const app = server();
11121112

1113-
let hasRequest = false;
1114-
let hasResponse = false;
1113+
let seenRequest;
1114+
let seenResponse;
11151115

11161116
app.get(
11171117
urlString(),
11181118
graphqlHTTP((req, res) => {
1119-
if (req) {
1120-
hasRequest = true;
1121-
}
1122-
if (res) {
1123-
hasResponse = true;
1124-
}
1119+
seenRequest = req;
1120+
seenResponse = res;
11251121
return { schema: TestSchema };
11261122
}),
11271123
);
11281124

11291125
await app.request().get(urlString({ query: '{test}' }));
11301126

1131-
expect(hasRequest).to.equal(true);
1132-
expect(hasResponse).to.equal(true);
1127+
expect(seenRequest).to.not.equal(undefined);
1128+
expect(seenResponse).to.not.equal(undefined);
11331129
});
11341130

11351131
describe('Error handling functionality', () => {

0 commit comments

Comments
 (0)