/** * Receiver stream constructor * * @param {object} test - test suite object * @param {mixed} fixture - fixture to check against */ function Receiver(test, fixture) { this.test = test; this.fixture = fixture; // turn on object mode Writable.call(this, {objectMode: true}); this.on('finish', function() { if (fixture.error) { test.fail('+ do not expect stream to have normal ending'); } else { test.ok(true, '+ stream finished successfully.'); } }); }
stream.Writable.call(this);