1'use strict'; 2const common = require('../common'); 3const assert = require('assert'); 4const { Readable, Writable, Transform } = require('stream'); 5 6{ 7 const stream = new Readable({ 8 objectMode: true, 9 read: common.mustCall(() => { 10 stream.push(undefined); 11 stream.push(null); 12 }) 13 }); 14 15 stream.on('data', common.mustCall((chunk) => { 16 assert.strictEqual(chunk, undefined); 17 })); 18} 19 20{ 21 const stream = new Writable({ 22 objectMode: true, 23 write: common.mustCall((chunk) => { 24 assert.strictEqual(chunk, undefined); 25 }) 26 }); 27 28 stream.write(undefined); 29} 30 31{ 32 const stream = new Transform({ 33 objectMode: true, 34 transform: common.mustCall((chunk) => { 35 stream.push(chunk); 36 }) 37 }); 38 39 stream.on('data', common.mustCall((chunk) => { 40 assert.strictEqual(chunk, undefined); 41 })); 42 43 stream.write(undefined); 44} 45