diff options
author | 2023-08-29 19:45:16 -0700 | |
---|---|---|
committer | 2023-08-29 19:45:16 -0700 | |
commit | a846852818278641cf33413ce784adf2fc0e2e52 (patch) | |
tree | 09a92d272b78226d9d4b1b94682100428da6af3f /test/js/node/http/node-fetch-cjs.test.js | |
parent | 3f4bc625ff2313713cf38c3c3ba036781ac1c9a9 (diff) | |
download | bun-a846852818278641cf33413ce784adf2fc0e2e52.tar.gz bun-a846852818278641cf33413ce784adf2fc0e2e52.tar.zst bun-a846852818278641cf33413ce784adf2fc0e2e52.zip |
fix(node-fetch): use stream.Readable instead of web streams (#4394)
* fix blobFrom
* fix(node-fetch): use stream.Readable instead of web streams
* uncomment
* comment why
Diffstat (limited to 'test/js/node/http/node-fetch-cjs.test.js')
-rw-r--r-- | test/js/node/http/node-fetch-cjs.test.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/js/node/http/node-fetch-cjs.test.js b/test/js/node/http/node-fetch-cjs.test.js new file mode 100644 index 000000000..9a6a4b407 --- /dev/null +++ b/test/js/node/http/node-fetch-cjs.test.js @@ -0,0 +1,13 @@ +const fetch = require("node-fetch"); + +test("require('node-fetch') fetches", async () => { + const server = Bun.serve({ + port: 0, + fetch(req, server) { + server.stop(); + return new Response(); + }, + }); + expect(await fetch("http://" + server.hostname + ":" + server.port)).toBeInstanceOf(Response); + server.stop(true); +}); |