From 8dfd3dbdbc38680cdcb7d1b6f72c9709712fb7b7 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 28 May 2023 13:30:25 -0700 Subject: [PATCH] Add query string to express integration test --- .../body-parser/express-body-parser-test.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/js/third_party/body-parser/express-body-parser-test.test.ts b/test/js/third_party/body-parser/express-body-parser-test.test.ts index c99eb81bcc..402bf3e1ad 100644 --- a/test/js/third_party/body-parser/express-body-parser-test.test.ts +++ b/test/js/third_party/body-parser/express-body-parser-test.test.ts @@ -39,13 +39,17 @@ test("httpServer", async () => { // This throws a TypeError since it uses body-parser.json app.post("/ping", (request: Request, response: Response) => { expect(request.body).toEqual({ hello: "world" }); + expect(request.query).toStrictEqual({ + hello: "123", + hi: "", + }); reached = true; response.status(200).send("POST - pong"); httpServer.close(); }); httpServer.listen(PORT); - const resp = await fetch(`http://localhost:${PORT}/ping`, { + const resp = await fetch(`http://localhost:${PORT}/ping?hello=123&hi`, { method: "POST", body: JSON.stringify({ hello: "world" }), headers: {