mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
ba40347a35
Implements https://github.com/whatwg/webidl/pull/1397 Fixes #21454 Closes #24849
18 lines
514 B
TypeScript
18 lines
514 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { assertEquals } from "@std/assert";
|
|
import { createReadStream } from "node:fs";
|
|
|
|
Deno.test("fetch node stream", async () => {
|
|
const file = createReadStream("tests/testdata/assets/fixture.json");
|
|
|
|
const response = await fetch("http://localhost:4545/echo_server", {
|
|
method: "POST",
|
|
body: file,
|
|
});
|
|
|
|
assertEquals(
|
|
await response.text(),
|
|
await Deno.readTextFile("tests/testdata/assets/fixture.json"),
|
|
);
|
|
});
|