Skip to content

Commit 1b8bba8

Browse files
mcollinaRafaelGSS
authored andcommitted
test: add regression test for 51586
Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #51491 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 662ac95 commit 1b8bba8

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

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)