1'use strict'; 2const common = require('../common'); 3const assert = require('assert'); 4 5const http = require('http'); 6const OutgoingMessage = http.OutgoingMessage; 7 8{ 9 const msg = new OutgoingMessage(); 10 assert.strictEqual(msg.destroyed, false); 11 msg.destroy(); 12 assert.strictEqual(msg.destroyed, true); 13 msg.write('asd', common.mustCall((err) => { 14 assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED'); 15 })); 16 msg.on('error', common.mustNotCall()); 17} 18