1
1
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
3
- import { assert , fail } from "../../../test_util/std/testing/asserts.ts" ;
3
+ import { assert } from "../../../test_util/std/testing/asserts.ts" ;
4
4
import { fromFileUrl , relative } from "../../../test_util/std/path/mod.ts" ;
5
5
import { pipeline } from "node:stream/promises" ;
6
- import { Writable } from "node:stream" ;
7
6
import { createReadStream , createWriteStream } from "node:fs" ;
8
7
9
8
Deno . test ( "stream/promises pipeline" , async ( ) => {
@@ -24,37 +23,3 @@ Deno.test("stream/promises pipeline", async () => {
24
23
// pass
25
24
}
26
25
} ) ;
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