diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2023-11-25 12:20:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-25 12:20:47 +0900 |
commit | 7d8f0ae038d44dd3fe25b3fa98157126f01b179b (patch) | |
tree | 31bea2dd0b36a1fe2e6962ba865b6c702111ee74 /cli/tests/unit_node/stream_test.ts | |
parent | 5710fffb120eba88e1b261e3ef379cb02575de42 (diff) |
chore(ext/node): remove unnecessary test case (#21337)
This test case is covered by the last case in
https://github.com/denoland/deno/blob/5710fffb120eba88e1b261e3ef379cb02575de42/cli/tests/node_compat/test/parallel/test-stream2-transform.js
and not necessary anymore.
Diffstat (limited to 'cli/tests/unit_node/stream_test.ts')
-rw-r--r-- | cli/tests/unit_node/stream_test.ts | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/cli/tests/unit_node/stream_test.ts b/cli/tests/unit_node/stream_test.ts index e63171df7..058d3ca7c 100644 --- a/cli/tests/unit_node/stream_test.ts +++ b/cli/tests/unit_node/stream_test.ts @@ -1,9 +1,8 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { assert, fail } from "../../../test_util/std/testing/asserts.ts"; +import { assert } from "../../../test_util/std/testing/asserts.ts"; import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import { pipeline } from "node:stream/promises"; -import { Writable } from "node:stream"; import { createReadStream, createWriteStream } from "node:fs"; Deno.test("stream/promises pipeline", async () => { @@ -24,37 +23,3 @@ Deno.test("stream/promises pipeline", async () => { // pass } }); - -// TODO(kt3k): Remove this test case when the node compat test suite is -// updated to version 18.16.0 or above. -// The last case in parallel/test-stream2-transform.js covers this case. -// See https://github.com/nodejs/node/pull/46818 -Deno.test("stream.Writable does not change the order of items", async () => { - async function test() { - const chunks: Uint8Array[] = []; - const writable = new Writable({ - construct(cb) { - setTimeout(cb, 10); - }, - write(chunk, _, cb) { - chunks.push(chunk); - cb(); - }, - }); - - for (const i of Array(20).keys()) { - writable.write(Uint8Array.from([i])); - await new Promise((resolve) => setTimeout(resolve, 1)); - } - - if (chunks[0][0] !== 0) { - // The first chunk is swapped with the later chunk. - fail("The first chunk is swapped"); - } - } - - for (const _ of Array(10)) { - // Run it multiple times to avoid flaky false negative. - await test(); - } -}); |