Skip to content

Commit f2dfe0f

Browse files
mcollinarichardlau
authored andcommitted
test: add regression test for 51586
Signed-off-by: Matteo Collina <[email protected]> PR-URL: #51491 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Matthew Aitken <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 6ee5f50 commit f2dfe0f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import'../common/index.mjs';
2+
import{test}from'node:test';
3+
importassertfrom'node:assert';
4+
5+
test('do not leak promises',async()=>{
6+
constbuf=newUint8Array(1);
7+
constreadable=newReadableStream({
8+
start(controller){
9+
controller.enqueue(buf);
10+
controller.close();
11+
}
12+
});
13+
14+
const[out1,out2]=readable.tee();
15+
constcloned=structuredClone(out2,{transfer: [out2]});
16+
17+
forawait(constchunkofcloned){
18+
assert.deepStrictEqual(chunk,buf);
19+
}
20+
21+
forawait(constchunkofout2){
22+
assert.deepStrictEqual(chunk,buf);
23+
}
24+
25+
forawait(constchunkofout1){
26+
assert.deepStrictEqual(chunk,buf);
27+
}
28+
});

0 commit comments

Comments
(0)