diff options
author | Weijia Wang <381152119@qq.com> | 2017-07-22 19:23:04 +0800 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2017-08-01 14:08:12 +0200 |
commit | bdfbce924159ece4b32ee7f774a263987e719972 (patch) | |
tree | 2134a4937c1d751de771abe92d00c8cf47fc2307 /test/parallel/test-http-client-unescaped-path.js | |
parent | 8db39971b768118ce2c0c34d88788daea14f52c9 (diff) | |
download | android-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-unescaped-path.js')
-rw-r--r-- | test/parallel/test-http-client-unescaped-path.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/parallel/test-http-client-unescaped-path.js b/test/parallel/test-http-client-unescaped-path.js index 11faaec41a..f3c680919d 100644 --- a/test/parallel/test-http-client-unescaped-path.js +++ b/test/parallel/test-http-client-unescaped-path.js @@ -24,8 +24,14 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); -const errMessage = /contains unescaped characters/; for (let i = 0; i <= 32; i += 1) { const path = `bad${String.fromCharCode(i)}path`; - assert.throws(() => http.get({ path }, common.mustNotCall()), errMessage); + assert.throws( + () => http.get({ path }, common.mustNotCall()), + common.expectsError({ + code: 'ERR_UNESCAPED_CHARACTERS', + type: TypeError, + message: 'Request path contains unescaped characters' + }) + ); } |