diff options
author | 2023-02-28 00:07:46 -0800 | |
---|---|---|
committer | 2023-02-28 00:12:32 -0800 | |
commit | d93d1013a6dce4aabbdd9fb6a12901daeaa51886 (patch) | |
tree | 3a73973e18e2f44b9496a499a2ffb60475a43cf0 /test/bun.js/fetch.test.js | |
parent | 12d6db0cad2554562f3f5034c3bc5c448702a270 (diff) | |
download | bun-d93d1013a6dce4aabbdd9fb6a12901daeaa51886.tar.gz bun-d93d1013a6dce4aabbdd9fb6a12901daeaa51886.tar.zst bun-d93d1013a6dce4aabbdd9fb6a12901daeaa51886.zip |
Add back the tests
Diffstat (limited to 'test/bun.js/fetch.test.js')
-rw-r--r-- | test/bun.js/fetch.test.js | 23 |
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(); + } +}); |