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

Commit 9be8386

Browse files
committed
Fix supertest usage inside tests
1 parent 975ba2c commit 9be8386

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/__tests__/http-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,8 @@ function runTests(server: Server) {
858858
.request()
859859
.post(urlString())
860860
.set('Content-Type', 'application/json')
861-
.set('Content-Encoding', 'gzip');
862-
863-
req.write(zlib.gzipSync('{ "query": "{ test }" }'));
861+
.set('Content-Encoding', 'gzip')
862+
.write(zlib.gzipSync('{ "query": "{ test }" }'));
864863

865864
const response = await req;
866865
expect(JSON.parse(response.text)).to.deep.equal({
@@ -884,9 +883,8 @@ function runTests(server: Server) {
884883
.request()
885884
.post(urlString())
886885
.set('Content-Type', 'application/json')
887-
.set('Content-Encoding', 'deflate');
888-
889-
req.write(zlib.deflateSync('{ "query": "{ test }" }'));
886+
.set('Content-Encoding', 'deflate')
887+
.write(zlib.deflateSync('{ "query": "{ test }" }'));
890888

891889
const response = await req;
892890
expect(JSON.parse(response.text)).to.deep.equal({
@@ -979,8 +977,8 @@ function runTests(server: Server) {
979977
const req = app
980978
.request()
981979
.post(urlString())
982-
.set('Content-Type', 'application/graphql');
983-
req.write(Buffer.from('{ test(who: "World") }'));
980+
.set('Content-Type', 'application/graphql')
981+
.write(Buffer.from('{ test(who: "World") }'));
984982
const response = await req;
985983

986984
expect(JSON.parse(response.text)).to.deep.equal({
@@ -996,8 +994,10 @@ function runTests(server: Server) {
996994

997995
app.post(urlString(), graphqlHTTP({ schema: TestSchema }));
998996

999-
const req = app.request().post(urlString());
1000-
req.write(Buffer.from('{ test(who: "World") }'));
997+
const req = app
998+
.request()
999+
.post(urlString())
1000+
.write(Buffer.from('{ test(who: "World") }'));
10011001
const response = await req;
10021002

10031003
expect(response.status).to.equal(400);
@@ -1015,8 +1015,8 @@ function runTests(server: Server) {
10151015
const req = app
10161016
.request()
10171017
.post(urlString())
1018-
.set('Content-Type', 'application/graphql');
1019-
req.write(Buffer.from('{ test(who: "World") }'));
1018+
.set('Content-Type', 'application/graphql')
1019+
.write(Buffer.from('{ test(who: "World") }'));
10201020
const response = await req;
10211021

10221022
expect(response.status).to.equal(400);

0 commit comments

Comments
 (0)