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:
parent
1a35db590f
commit
19e44efdfb
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user