Skip to content

Commit 26a2ae2

Browse files
MoLowRafaelGSS
authored andcommitted
test: wrap missing common.mustCall
PR-URL: #45064 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Erick Wendel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b4bedde commit 26a2ae2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/parallel/test-stream-promises.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,30 @@ assert.strictEqual(finished, promisify(stream.finished));
119119
{
120120
const streamObj = new Writable();
121121
assert.strictEqual(streamObj.listenerCount('end'), 0);
122-
finished(streamObj, { cleanup: false }).then(() => {
122+
finished(streamObj, { cleanup: false }).then(common.mustCall(() => {
123123
assert.strictEqual(streamObj.listenerCount('end'), 1);
124-
});
124+
}));
125+
streamObj.end();
125126
}
126127

127128
// Cleanup function should be called when cleanup is set to true
128129
// listenerCount should be 0 after calling finish
129130
{
130131
const streamObj = new Writable();
131132
assert.strictEqual(streamObj.listenerCount('end'), 0);
132-
finished(streamObj, { cleanup: true }).then(() => {
133+
finished(streamObj, { cleanup: true }).then(common.mustCall(() => {
133134
assert.strictEqual(streamObj.listenerCount('end'), 0);
134-
});
135+
}));
136+
streamObj.end();
135137
}
136138

137139
// Cleanup function should not be called when cleanup has not been set
138140
// listenerCount should be 1 after calling finish
139141
{
140142
const streamObj = new Writable();
141143
assert.strictEqual(streamObj.listenerCount('end'), 0);
142-
finished(streamObj).then(() => {
144+
finished(streamObj).then(common.mustCall(() => {
143145
assert.strictEqual(streamObj.listenerCount('end'), 1);
144-
});
146+
}));
147+
streamObj.end();
145148
}

0 commit comments

Comments
 (0)