diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-08-06 00:13:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 00:13:02 -0700 |
commit | ba40347a35d10cffeae83ee95f69f7bc281096dd (patch) | |
tree | 0e981a32601937293967815292d5bf617914163a /tests/unit/streams_test.ts | |
parent | f0cd2c45fcd4dfb841cee9d36bdda3be25c1a2a5 (diff) |
feat(fetch): accept async iterables for body (#24623)
Implements https://github.com/whatwg/webidl/pull/1397
Fixes #21454
Closes #24849
Diffstat (limited to 'tests/unit/streams_test.ts')
-rw-r--r-- | tests/unit/streams_test.ts | 15 |
1 files changed, 14 insertions, 1 deletions
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.", + ); +}); |