test: add common.mustCall() to stream test

Refs: https://github.com/nodejs/node/pull/30561/files#r348667256

PR-URL: https://github.com/nodejs/node/pull/30561
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Rich Trott 2019-11-20 13:10:18 -08:00
parent 1a35db590f
commit 19e44efdfb

View File

@ -3,7 +3,7 @@
// This test ensures that the _writeableState.bufferedRequestCount and
// the actual buffered request count are the same.
require('../common');
const common = require('../common');
const Stream = require('stream');
const assert = require('assert');
@ -24,12 +24,12 @@ const testStream = new StreamWritable();
testStream.cork();
for (let i = 1; i <= 5; i++) {
testStream.write(i, () => {
testStream.write(i, common.mustCall(() => {
assert.strictEqual(
testStream._writableState.bufferedRequestCount,
testStream._writableState.getBuffer().length
);
});
}));
}
testStream.end();