diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-02-02 19:05:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 12:05:46 +0100 |
commit | 6abf126c2a7a451cded8c6b5e6ddf1b69c84055d (patch) | |
tree | fd94c013a19fcb38954844085821ec1601c20e18 /std/async/mux_async_iterator_test.ts | |
parent | a2b5d44f1aa9d64f448a2a3cc2001272e2f60b98 (diff) |
chore: remove std directory (#9361)
This removes the std folder from the tree.
Various parts of the tests are pretty tightly dependent
on std (47 direct imports and 75 indirect imports, not
counting the cli tests that use them as fixtures) so I've
added std as a submodule for now.
Diffstat (limited to 'std/async/mux_async_iterator_test.ts')
-rw-r--r-- | std/async/mux_async_iterator_test.ts | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/std/async/mux_async_iterator_test.ts b/std/async/mux_async_iterator_test.ts deleted file mode 100644 index e1bdb47b4..000000000 --- a/std/async/mux_async_iterator_test.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrowsAsync } from "../testing/asserts.ts"; -import { MuxAsyncIterator } from "./mux_async_iterator.ts"; - -async function* gen123(): AsyncIterableIterator<number> { - yield 1; - yield 2; - yield 3; -} - -async function* gen456(): AsyncIterableIterator<number> { - yield 4; - yield 5; - yield 6; -} - -async function* genThrows(): AsyncIterableIterator<number> { - yield 7; - throw new Error("something went wrong"); -} - -Deno.test("[async] MuxAsyncIterator", async function (): Promise<void> { - const mux = new MuxAsyncIterator<number>(); - mux.add(gen123()); - mux.add(gen456()); - const results = new Set(); - for await (const value of mux) { - results.add(value); - } - assertEquals(results.size, 6); -}); - -Deno.test({ - name: "[async] MuxAsyncIterator throws", - async fn() { - const mux = new MuxAsyncIterator<number>(); - mux.add(gen123()); - mux.add(genThrows()); - const results = new Set(); - await assertThrowsAsync( - async () => { - for await (const value of mux) { - results.add(value); - } - }, - Error, - "something went wrong", - ); - }, -}); |