Skip to content

Commit b23f246

Browse files
Trottaddaleax
authored andcommitted
test: refactor test-stream2-writable
* Use common.mustCall() to confirm that _write() is called only once. * Check that _write() is called with the correct argument PR-URL: #13823 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 0ef687e commit b23f246

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-stream2-writable.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ for (let i = 0; i < chunks.length; i++) {
294294
{
295295
// Verify that end(chunk) twice is an error
296296
const w = new W();
297-
w._write = common.noop;
297+
w._write = common.mustCall((msg) => {
298+
assert.strictEqual(msg.toString(), 'this is the end');
299+
});
298300
let gotError = false;
299301
w.on('error', function(er) {
300302
gotError = true;

0 commit comments

Comments
 (0)