From 2077864a8deca240fbbd43758e30977cc881e110 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Mon, 18 Jan 2021 10:40:39 +1100 Subject: fix(op_crate/fetch): add back ReadableStream.getIterator and deprecate (#9146) --- cli/tests/unit/streams_deprecated.ts | 16 ++++++++++++++++ cli/tests/unit/unit_tests.ts | 1 + 2 files changed, 17 insertions(+) create mode 100644 cli/tests/unit/streams_deprecated.ts (limited to 'cli/tests') diff --git a/cli/tests/unit/streams_deprecated.ts b/cli/tests/unit/streams_deprecated.ts new file mode 100644 index 000000000..77750072c --- /dev/null +++ b/cli/tests/unit/streams_deprecated.ts @@ -0,0 +1,16 @@ +// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +import { assertEquals, unitTest } from "./test_util.ts"; + +unitTest(async function symlinkSyncPerm() { + const rs = new ReadableStream({ + start(controller) { + controller.enqueue("hello "); + controller.enqueue("deno"); + controller.close(); + }, + }); + + for await (const chunk of rs.getIterator()) { + assertEquals(typeof chunk, "string"); + } +}); diff --git a/cli/tests/unit/unit_tests.ts b/cli/tests/unit/unit_tests.ts index 69eaac3ed..8af28c1bb 100644 --- a/cli/tests/unit/unit_tests.ts +++ b/cli/tests/unit/unit_tests.ts @@ -57,6 +57,7 @@ import "./response_test.ts"; import "./signal_test.ts"; import "./stat_test.ts"; import "./stdio_test.ts"; +import "./streams_deprecated.ts"; import "./symlink_test.ts"; import "./sync_test.ts"; import "./text_encoding_test.ts"; -- cgit v1.2.3