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

Commit e0d06a2

Browse files
committed
Fix middleware thunk test
1 parent 975ba2c commit e0d06a2

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
@@ -1111,26 +1111,22 @@ function runTests(server: Server) {
11111111
it('will send request and response when using thunk', async () => {
11121112
const app = server();
11131113

1114-
let hasRequest = false;
1115-
let hasResponse = false;
1114+
let seenRequest;
1115+
let seenResponse;
11161116

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

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

1132-
expect(hasRequest).to.equal(true);
1133-
expect(hasResponse).to.equal(true);
1128+
expect(seenRequest).to.not.equal(undefined);
1129+
expect(seenResponse).to.not.equal(undefined);
11341130
});
11351131

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

0 commit comments

Comments
 (0)