Skip to content

Commit 20cc6ca

Browse files
committed
add option request unit test
1 parent c0357f3 commit 20cc6ca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/server.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,17 @@ describe("server test", () => {
1414
done();
1515
});
1616
});
17+
it("check option request", (done: jest.DoneCallback) => {
18+
request(app)
19+
.options("/graphql")
20+
.expect(204)
21+
.end((err, res: request.Response) => {
22+
expect(err).toBeNull();
23+
expect(res.header["access-control-allow-methods"]).toBe("POST");
24+
// console.log(err);
25+
console.log(res);
26+
done();
27+
});
28+
29+
});
1730
});

0 commit comments

Comments
 (0)