Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! stream: add iterator helper find
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkgoron committed Feb 5, 2022
1 parent 543f5b3 commit e0b1109
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test/parallel/test-stream-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const { setTimeout } = require('timers/promises');
}
{
const stream = Readable.from([1, 2, 3, 4, 5]);
stream.map = common.mustNotCall(() => {});
Object.defineProperty(stream, 'map', {
value: common.mustNotCall(() => {}),
});
// Check that map isn't getting called.
stream.filter(() => true);
}
4 changes: 3 additions & 1 deletion test/parallel/test-stream-flatMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ function oneTo5() {
}
{
const stream = oneTo5();
stream.map = common.mustNotCall(() => {});
Object.defineProperty(stream, 'map', {
value: common.mustNotCall(() => {}),
});
// Check that map isn't getting called.
stream.flatMap(() => true);
}
4 changes: 3 additions & 1 deletion test/parallel/test-stream-forEach.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ const { setTimeout } = require('timers/promises');
}
{
const stream = Readable.from([1, 2, 3, 4, 5]);
stream.map = common.mustNotCall(() => {});
Object.defineProperty(stream, 'map', {
value: common.mustNotCall(() => {}),
});
// Check that map isn't getting called.
stream.forEach(() => true);
}
4 changes: 3 additions & 1 deletion test/parallel/test-stream-some-find-every.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ function oneTo5Async() {
{
for (const op of ['some', 'every', 'find']) {
const stream = oneTo5();
stream.map = common.mustNotCall(() => {});
Object.defineProperty(stream, 'map', {
value: common.mustNotCall(() => {}),
});
// Check that map isn't getting called.
stream[op](() => {});
}
Expand Down

0 comments on commit e0b1109

Please sign in to comment.