Skip to content

Commit 5fc7d5e

Browse files
committed
JS: Add tests with missing flow.
1 parent 579bfe9 commit 5fc7d5e

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+
consumeChunk(chunk[0]); // $ MISSING: flow=map-key
33+
consumeChunk(chunk[1]); // $ MISSING: flow=map-value
34+
consumeChunk(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+
consumeChunk(mapKey); // $ MISSING: flow=map-key
42+
consumeChunk(mapValue); // $ MISSING: flow=map-value
43+
}
44+
Readable.from(iterableMap).pipe(new MapDestination());
45+
3046
class GeneratorDestination extends Writable {
3147
write(chunk) {
3248
consumeChunk(chunk); // $ flow=generator

0 commit comments

Comments
 (0)