1'use strict'; 2const common = require('../common'); 3 4const { Writable } = require('stream'); 5 6{ 7 const w = new Writable({ 8 write(chunk, encoding, callback) { 9 callback(null); 10 }, 11 final(callback) { 12 queueMicrotask(callback); 13 } 14 }); 15 w.end(); 16 w.destroy(); 17 18 w.on('prefinish', common.mustNotCall()); 19 w.on('finish', common.mustNotCall()); 20 w.on('close', common.mustCall()); 21} 22