Skip to content

Commit 408d9e6

Browse files
committed
JS: Add tests with missing flow.
1 parent bad4552 commit 408d9e6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎javascript/ql/test/library-tests/frameworks/NodeJSLib/stream-pipe.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ class SetDestination extends Writable {
2727

2828
Readable.from(new Set([source("set")])).pipe(new SetDestination());
2929

30+
class MapDestination extends Writable {
31+
write(chunk) {
32+
sink(chunk[0]); // $ MISSING: flow=map-key
33+
sink(chunk[1]); // $ MISSING: flow=map-value
34+
sink(chunk);
35+
return true;
36+
}
37+
}
38+
39+
const iterableMap = new Map([[source("map-key"), source("map-value")]]);
40+
for (const [mapKey, mapValue] of iterableMap) {
41+
sink(mapKey); // $ MISSING: flow=map-key
42+
sink(mapValue); // $ MISSING: flow=map-value
43+
}
44+
Readable.from(iterableMap).pipe(new MapDestination());
45+
3046
class GeneratorDestination extends Writable {
3147
write(chunk) {
3248
sink(chunk); // $ flow=generator

0 commit comments

Comments
 (0)