summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-client-check-http-token.js
diff options
context:
space:
mode:
authorWeijia Wang <381152119@qq.com>2017-07-22 19:23:04 +0800
committerTobias Nießen <tniessen@tnie.de>2017-08-01 14:08:12 +0200
commitbdfbce924159ece4b32ee7f774a263987e719972 (patch)
tree2134a4937c1d751de771abe92d00c8cf47fc2307 /test/parallel/test-http-client-check-http-token.js
parent8db39971b768118ce2c0c34d88788daea14f52c9 (diff)
downloadandroid-node-v8-bdfbce924159ece4b32ee7f774a263987e719972.tar.gz
android-node-v8-bdfbce924159ece4b32ee7f774a263987e719972.tar.bz2
android-node-v8-bdfbce924159ece4b32ee7f774a263987e719972.zip
http_client, errors: migrate to internal/errors
PR-URL: https://github.com/nodejs/node/pull/14423 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test/parallel/test-http-client-check-http-token.js')
-rw-r--r--test/parallel/test-http-client-check-http-token.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/parallel/test-http-client-check-http-token.js b/test/parallel/test-http-client-check-http-token.js
index 4fa3a44802..7a0c894504 100644
--- a/test/parallel/test-http-client-check-http-token.js
+++ b/test/parallel/test-http-client-check-http-token.js
@@ -20,7 +20,12 @@ server.listen(0, common.mustCall(() => {
expectedFails.forEach((method) => {
assert.throws(() => {
http.request({ method, path: '/' }, common.mustNotCall());
- }, /^TypeError: Method must be a string$/);
+ }, common.expectsError({
+ code: 'ERR_INVALID_ARG_TYPE',
+ type: TypeError,
+ message: 'The "method" argument must be of type string. ' +
+ `Received type ${typeof method}`
+ }));
});
expectedSuccesses.forEach((method) => {