diff options
Diffstat (limited to 'test/parallel/test-http-outgoing-renderHeaders.js')
-rw-r--r-- | test/parallel/test-http-outgoing-renderHeaders.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/parallel/test-http-outgoing-renderHeaders.js b/test/parallel/test-http-outgoing-renderHeaders.js index bae7fc5812..138ab96753 100644 --- a/test/parallel/test-http-outgoing-renderHeaders.js +++ b/test/parallel/test-http-outgoing-renderHeaders.js @@ -1,7 +1,7 @@ 'use strict'; // Flags: --expose-internals -require('../common'); +const common = require('../common'); const assert = require('assert'); const outHeadersKey = require('internal/http').outHeadersKey; @@ -11,9 +11,13 @@ const OutgoingMessage = http.OutgoingMessage; { const outgoingMessage = new OutgoingMessage(); outgoingMessage._header = {}; - assert.throws( + common.expectsError( outgoingMessage._renderHeaders.bind(outgoingMessage), - /^Error: Can't render headers after they are sent to the client$/ + { + code: 'ERR_HTTP_HEADERS_SENT', + type: Error, + message: 'Cannot render headers after they are sent to the client' + } ); } |