From ba40347a35d10cffeae83ee95f69f7bc281096dd Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 6 Aug 2024 00:13:02 -0700 Subject: feat(fetch): accept async iterables for body (#24623) Implements https://github.com/whatwg/webidl/pull/1397 Fixes #21454 Closes #24849 --- tests/unit/streams_test.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/streams_test.ts b/tests/unit/streams_test.ts index 80b45e602..c0adbda07 100644 --- a/tests/unit/streams_test.ts +++ b/tests/unit/streams_test.ts @@ -1,5 +1,10 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertRejects, fail } from "./test_util.ts"; +import { + assertEquals, + assertRejects, + assertThrows, + fail, +} from "./test_util.ts"; const { core, @@ -533,3 +538,11 @@ Deno.test(async function decompressionStreamInvalidGzipStillReported() { "corrupt gzip stream does not have a matching checksum", ); }); + +Deno.test(function readableStreamFromWithStringThrows() { + assertThrows( + () => ReadableStream.from("string"), + TypeError, + "Failed to execute 'ReadableStream.from': Argument 1 can not be converted to async iterable.", + ); +}); -- cgit v1.2.3