Skip to content

Commit

Permalink
test: add common.mustCall() to stream test
Browse files Browse the repository at this point in the history
Refs: https://github.com/nodejs/node/pull/30561/files#r348667256

PR-URL: #30561
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott committed Nov 22, 2019
1 parent 1a35db5 commit 19e44ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-stream-writable-clear-buffer.js
Expand Up @@ -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');

Expand All @@ -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();

0 comments on commit 19e44ef

Please sign in to comment.