Skip to content

Commit 7d8f0ae

Browse files
authored
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.
1 parent 5710fff commit 7d8f0ae

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

cli/tests/unit_node/stream_test.ts

+1-36
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
22

3-
import { assert, fail } from "../../../test_util/std/testing/asserts.ts";
3+
import { assert } from "../../../test_util/std/testing/asserts.ts";
44
import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts";
55
import { pipeline } from "node:stream/promises";
6-
import { Writable } from "node:stream";
76
import { createReadStream, createWriteStream } from "node:fs";
87

98
Deno.test("stream/promises pipeline", async () => {
@@ -24,37 +23,3 @@ Deno.test("stream/promises pipeline", async () => {
2423
// pass
2524
}
2625
});
27-
28-
// TODO(kt3k): Remove this test case when the node compat test suite is
29-
// updated to version 18.16.0 or above.
30-
// The last case in parallel/test-stream2-transform.js covers this case.
31-
// See https://github.com/nodejs/node/pull/46818
32-
Deno.test("stream.Writable does not change the order of items", async () => {
33-
async function test() {
34-
const chunks: Uint8Array[] = [];
35-
const writable = new Writable({
36-
construct(cb) {
37-
setTimeout(cb, 10);
38-
},
39-
write(chunk, _, cb) {
40-
chunks.push(chunk);
41-
cb();
42-
},
43-
});
44-
45-
for (const i of Array(20).keys()) {
46-
writable.write(Uint8Array.from([i]));
47-
await new Promise((resolve) => setTimeout(resolve, 1));
48-
}
49-
50-
if (chunks[0][0] !== 0) {
51-
// The first chunk is swapped with the later chunk.
52-
fail("The first chunk is swapped");
53-
}
54-
}
55-
56-
for (const _ of Array(10)) {
57-
// Run it multiple times to avoid flaky false negative.
58-
await test();
59-
}
60-
});

0 commit comments

Comments
 (0)