diff options
author | 2023-03-03 18:45:34 +0800 | |
---|---|---|
committer | 2023-03-03 02:45:34 -0800 | |
commit | 18178b4e48b9b5b96798681a028637ebbd43f6df (patch) | |
tree | 09d8fabe0d26c689ad02bff7efaa8bddc227fa35 /test/bun.js/node-http.test.ts | |
parent | 3456831b82c4b95887cd96761e91b5edec95d683 (diff) | |
download | bun-18178b4e48b9b5b96798681a028637ebbd43f6df.tar.gz bun-18178b4e48b9b5b96798681a028637ebbd43f6df.tar.zst bun-18178b4e48b9b5b96798681a028637ebbd43f6df.zip |
Fix http server req url (#2285)
* fix: http url add search query
* fix: add tests
Diffstat (limited to 'test/bun.js/node-http.test.ts')
-rw-r--r-- | test/bun.js/node-http.test.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/bun.js/node-http.test.ts b/test/bun.js/node-http.test.ts index 7818fba62..6ba619c3e 100644 --- a/test/bun.js/node-http.test.ts +++ b/test/bun.js/node-http.test.ts @@ -6,12 +6,13 @@ describe("node:http", () => { describe("createServer", async () => { it("hello world", async () => { const server = createServer((req, res) => { + expect(req.url).toBe("/hello?world"); res.writeHead(200, { "Content-Type": "text/plain" }); res.end("Hello World"); }); server.listen(8123); - const res = await fetch("http://localhost:8123"); + const res = await fetch("http://localhost:8123/hello?world"); expect(await res.text()).toBe("Hello World"); server.close(); }); |