Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions test/parallel/test-stream2-writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ for (let i = 0; i < chunks.length; i++) {
});

tw.on('finish', common.mustCall(function() {
assert.deepStrictEqual(tw.buffer, chunks, 'got chunks in the right order');
// got chunks in the right order
assert.deepStrictEqual(tw.buffer, chunks);
}));

chunks.forEach(function(chunk) {
Expand All @@ -72,7 +73,8 @@ for (let i = 0; i < chunks.length; i++) {
});

tw.on('finish', common.mustCall(function() {
assert.deepStrictEqual(tw.buffer, chunks, 'got chunks in the right order');
// got chunks in the right order
assert.deepStrictEqual(tw.buffer, chunks);
}));

let i = 0;
Expand All @@ -94,7 +96,8 @@ for (let i = 0; i < chunks.length; i++) {
let drains = 0;

tw.on('finish', common.mustCall(function() {
assert.deepStrictEqual(tw.buffer, chunks, 'got chunks in the right order');
// got chunks in the right order
assert.deepStrictEqual(tw.buffer, chunks);
assert.strictEqual(drains, 17);
}));

Expand Down Expand Up @@ -139,7 +142,8 @@ for (let i = 0; i < chunks.length; i++) {
undefined ];

tw.on('finish', function() {
assert.deepStrictEqual(tw.buffer, chunks, 'got the expected chunks');
// got the expected chunks
assert.deepStrictEqual(tw.buffer, chunks);
});

chunks.forEach(function(chunk, i) {
Expand Down Expand Up @@ -177,7 +181,8 @@ for (let i = 0; i < chunks.length; i++) {
undefined ];

tw.on('finish', function() {
assert.deepStrictEqual(tw.buffer, chunks, 'got the expected chunks');
// got the expected chunks
assert.deepStrictEqual(tw.buffer, chunks);
});

chunks.forEach(function(chunk, i) {
Expand Down Expand Up @@ -205,9 +210,10 @@ for (let i = 0; i < chunks.length; i++) {

tw.on('finish', common.mustCall(function() {
process.nextTick(common.mustCall(function() {
assert.deepStrictEqual(tw.buffer, chunks,
'got chunks in the right order');
assert.deepStrictEqual(callbacks._called, chunks, 'called all callbacks');
// got chunks in the right order
assert.deepStrictEqual(tw.buffer, chunks);
// called all callbacks
assert.deepStrictEqual(callbacks._called, chunks);
}));
}));

Expand Down