diff options
author | Morgan Roderick <morgan@roderick.dk> | 2018-11-06 15:24:26 +0000 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-22 04:45:27 -0800 |
commit | 91748dd89c652939d52f38b94afe9eae4eb8fd5d (patch) | |
tree | f9e073cd648c5b969423ac753fce1a4215fd9701 /test | |
parent | 070995d5866beb31ee2b64ece90b883674a95b40 (diff) | |
download | android-node-v8-91748dd89c652939d52f38b94afe9eae4eb8fd5d.tar.gz android-node-v8-91748dd89c652939d52f38b94afe9eae4eb8fd5d.tar.bz2 android-node-v8-91748dd89c652939d52f38b94afe9eae4eb8fd5d.zip |
http: change DEP0066 to a runtime deprecation
Change doc-only deprecation for _headers and _headerNames accessors to a
runtime deprecation.
PR-URL: https://github.com/nodejs/node/pull/24167
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'test')
3 files changed, 31 insertions, 0 deletions
diff --git a/test/parallel/test-http-outgoing-internal-headernames-getter.js b/test/parallel/test-http-outgoing-internal-headernames-getter.js new file mode 100644 index 0000000000..c8bd1f13d5 --- /dev/null +++ b/test/parallel/test-http-outgoing-internal-headernames-getter.js @@ -0,0 +1,13 @@ +'use strict'; +const common = require('../common'); + +const { OutgoingMessage } = require('http'); + +const warn = 'OutgoingMessage.prototype._headerNames is deprecated'; +common.expectWarning('DeprecationWarning', warn, 'DEP0066'); + +{ + // tests for _headerNames get method + const outgoingMessage = new OutgoingMessage(); + outgoingMessage._headerNames; +} diff --git a/test/parallel/test-http-outgoing-internal-headernames-setter.js b/test/parallel/test-http-outgoing-internal-headernames-setter.js new file mode 100644 index 0000000000..7329076698 --- /dev/null +++ b/test/parallel/test-http-outgoing-internal-headernames-setter.js @@ -0,0 +1,15 @@ +'use strict'; +const common = require('../common'); + +const { OutgoingMessage } = require('http'); + +const warn = 'OutgoingMessage.prototype._headerNames is deprecated'; +common.expectWarning('DeprecationWarning', warn, 'DEP0066'); + +{ + // tests for _headerNames set method + const outgoingMessage = new OutgoingMessage(); + outgoingMessage._headerNames = { + 'x-flow-id': '61bba6c5-28a3-4eab-9241-2ecaa6b6a1fd' + }; +} diff --git a/test/parallel/test-http-outgoing-internal-headers.js b/test/parallel/test-http-outgoing-internal-headers.js index de75a44e8a..2cebfe9e2b 100644 --- a/test/parallel/test-http-outgoing-internal-headers.js +++ b/test/parallel/test-http-outgoing-internal-headers.js @@ -6,6 +6,9 @@ const assert = require('assert'); const { outHeadersKey } = require('internal/http'); const { OutgoingMessage } = require('http'); +const warn = 'OutgoingMessage.prototype._headers is deprecated'; +common.expectWarning('DeprecationWarning', warn, 'DEP0066'); + { // tests for _headers get method const outgoingMessage = new OutgoingMessage(); |