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
test: refactor test-stream2-writable
* Use common.mustCall() to confirm that _write() is called only once.
* Check that _write() is called with the correct argument
  • Loading branch information
Trott committed Jun 20, 2017
commit 9f82402dfadc98bd3630b8f42bc866fb29fc66cc
4 changes: 3 additions & 1 deletion test/parallel/test-stream2-writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ for (let i = 0; i < chunks.length; i++) {
{
// Verify that end(chunk) twice is an error
const w = new W();
w._write = common.noop;
w._write = common.mustCall((msg) => {
assert.strictEqual(msg.toString(), 'this is the end');
});
let gotError = false;
w.on('error', function(er) {
gotError = true;
Expand Down