-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #31818 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
- Loading branch information
Showing
5 changed files
with
86 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
|
||
const http = require('http'); | ||
const OutgoingMessage = http.OutgoingMessage; | ||
|
||
{ | ||
const msg = new OutgoingMessage(); | ||
assert.strictEqual(msg.destroyed, false); | ||
msg.destroy(); | ||
assert.strictEqual(msg.destroyed, true); | ||
let callbackCalled = false; | ||
msg.write('asd', common.mustCall((err) => { | ||
assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED'); | ||
callbackCalled = true; | ||
})); | ||
msg.on('error', common.mustCall((err) => { | ||
assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED'); | ||
assert.strictEqual(callbackCalled, true); | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters