From e0b110985619f456c7dc524f70d7dd5c09ba9271 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Sat, 5 Feb 2022 21:47:50 +0200 Subject: [PATCH] fixup! fixup! fixup! fixup! stream: add iterator helper find --- test/parallel/test-stream-filter.js | 4 +++- test/parallel/test-stream-flatMap.js | 4 +++- test/parallel/test-stream-forEach.js | 4 +++- test/parallel/test-stream-some-find-every.mjs | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-stream-filter.js b/test/parallel/test-stream-filter.js index fc18bf5108031a..4eeb877980b971 100644 --- a/test/parallel/test-stream-filter.js +++ b/test/parallel/test-stream-filter.js @@ -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); } diff --git a/test/parallel/test-stream-flatMap.js b/test/parallel/test-stream-flatMap.js index 672b1baf625d8e..07c534a9c1f481 100644 --- a/test/parallel/test-stream-flatMap.js +++ b/test/parallel/test-stream-flatMap.js @@ -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); } diff --git a/test/parallel/test-stream-forEach.js b/test/parallel/test-stream-forEach.js index 63ae387cc170e4..e26310e3bccb85 100644 --- a/test/parallel/test-stream-forEach.js +++ b/test/parallel/test-stream-forEach.js @@ -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); } diff --git a/test/parallel/test-stream-some-find-every.mjs b/test/parallel/test-stream-some-find-every.mjs index 6e89952fb802a5..1b657128a2695d 100644 --- a/test/parallel/test-stream-some-find-every.mjs +++ b/test/parallel/test-stream-some-find-every.mjs @@ -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](() => {}); }