aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-02-28 00:07:46 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-02-28 00:12:32 -0800
commitd93d1013a6dce4aabbdd9fb6a12901daeaa51886 (patch)
tree3a73973e18e2f44b9496a499a2ffb60475a43cf0
parent12d6db0cad2554562f3f5034c3bc5c448702a270 (diff)
downloadbun-d93d1013a6dce4aabbdd9fb6a12901daeaa51886.tar.gz
bun-d93d1013a6dce4aabbdd9fb6a12901daeaa51886.tar.zst
bun-d93d1013a6dce4aabbdd9fb6a12901daeaa51886.zip
Add back the tests
-rw-r--r--test/bun.js/fetch.test.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/bun.js/fetch.test.js b/test/bun.js/fetch.test.js
index ec903341f..d8422dca4 100644
--- a/test/bun.js/fetch.test.js
+++ b/test/bun.js/fetch.test.js
@@ -1034,3 +1034,26 @@ describe("Headers", () => {
gc();
});
});
+
+it("body nullable", async () => {
+ gc();
+ {
+ const req = new Request("https://hello.com", { body: null });
+ expect(req.body).toBeNull();
+ }
+ gc();
+ {
+ const req = new Request("https://hello.com", { body: undefined });
+ expect(req.body).toBeNull();
+ }
+ gc();
+ {
+ const req = new Request("https://hello.com");
+ expect(req.body).toBeNull();
+ }
+ gc();
+ {
+ const req = new Request("https://hello.com", { body: "" });
+ expect(req.body).not.toBeNull();
+ }
+});