From 26a2ae24892bc13ccc50e80e181f6915f60f79c7 Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Thu, 20 Oct 2022 11:40:29 +0300 Subject: [PATCH] test: wrap missing `common.mustCall` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/45064 Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy Reviewed-By: Tobias Nießen Reviewed-By: Yagiz Nizipli Reviewed-By: Erick Wendel Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-stream-promises.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-stream-promises.js b/test/parallel/test-stream-promises.js index fae2c37492eb5a..9748cbf86e1517 100644 --- a/test/parallel/test-stream-promises.js +++ b/test/parallel/test-stream-promises.js @@ -119,9 +119,10 @@ assert.strictEqual(finished, promisify(stream.finished)); { const streamObj = new Writable(); assert.strictEqual(streamObj.listenerCount('end'), 0); - finished(streamObj, { cleanup: false }).then(() => { + finished(streamObj, { cleanup: false }).then(common.mustCall(() => { assert.strictEqual(streamObj.listenerCount('end'), 1); - }); + })); + streamObj.end(); } // Cleanup function should be called when cleanup is set to true @@ -129,9 +130,10 @@ assert.strictEqual(finished, promisify(stream.finished)); { const streamObj = new Writable(); assert.strictEqual(streamObj.listenerCount('end'), 0); - finished(streamObj, { cleanup: true }).then(() => { + finished(streamObj, { cleanup: true }).then(common.mustCall(() => { assert.strictEqual(streamObj.listenerCount('end'), 0); - }); + })); + streamObj.end(); } // Cleanup function should not be called when cleanup has not been set @@ -139,7 +141,8 @@ assert.strictEqual(finished, promisify(stream.finished)); { const streamObj = new Writable(); assert.strictEqual(streamObj.listenerCount('end'), 0); - finished(streamObj).then(() => { + finished(streamObj).then(common.mustCall(() => { assert.strictEqual(streamObj.listenerCount('end'), 1); - }); + })); + streamObj.end(); }