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 authored and MylesBorins committed Dec 17, 2019
1 parent 516bdaf commit 88bca0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-stream-writable-clear-buffer.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This test ensures that the _writeableState.bufferedRequestCount and // This test ensures that the _writeableState.bufferedRequestCount and
// the actual buffered request count are the same. // the actual buffered request count are the same.


require('../common'); const common = require('../common');
const Stream = require('stream'); const Stream = require('stream');
const assert = require('assert'); const assert = require('assert');


Expand All @@ -24,12 +24,12 @@ const testStream = new StreamWritable();
testStream.cork(); testStream.cork();


for (let i = 1; i <= 5; i++) { for (let i = 1; i <= 5; i++) {
testStream.write(i, () => { testStream.write(i, common.mustCall(() => {
assert.strictEqual( assert.strictEqual(
testStream._writableState.bufferedRequestCount, testStream._writableState.bufferedRequestCount,
testStream._writableState.getBuffer().length testStream._writableState.getBuffer().length
); );
}); }));
} }


testStream.end(); testStream.end();

0 comments on commit 88bca0f

Please sign in to comment.