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 targos committed Dec 1, 2019
1 parent 4dd0f5a commit c2a5da1
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 Diff line number Diff line change
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 c2a5da1

Please sign in to comment.