diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-03-20 14:29:54 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-04-04 09:51:44 -0700 |
commit | c4469c49ecc2d6624466466e6b496c31d0e9fbed (patch) | |
tree | e838ff4c325b7b2b17088d0b0322cfe17199842d /test | |
parent | f6ddbaff8afda2c3f070ae5acb748aac76d06f54 (diff) | |
download | android-node-v8-c4469c49ecc2d6624466466e6b496c31d0e9fbed.tar.gz android-node-v8-c4469c49ecc2d6624466466e6b496c31d0e9fbed.tar.bz2 android-node-v8-c4469c49ecc2d6624466466e6b496c31d0e9fbed.zip |
url: error when domainTo*() is called w/o argument
PR-URL: https://github.com/nodejs/node/pull/12134
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-whatwg-url-domainto.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/parallel/test-whatwg-url-domainto.js b/test/parallel/test-whatwg-url-domainto.js index f891f95a19..70b32c8dce 100644 --- a/test/parallel/test-whatwg-url-domainto.js +++ b/test/parallel/test-whatwg-url-domainto.js @@ -13,6 +13,15 @@ const { domainToASCII, domainToUnicode } = require('url'); const tests = require('../fixtures/url-idna.js'); { + assert.throws(() => domainToASCII(), + /^TypeError: "domain" argument must be specified$/); + assert.throws(() => domainToUnicode(), + /^TypeError: "domain" argument must be specified$/); + assert.strictEqual(domainToASCII(undefined), 'undefined'); + assert.strictEqual(domainToUnicode(undefined), 'undefined'); +} + +{ for (const [i, { ascii, unicode }] of tests.valid.entries()) { assert.strictEqual(ascii, domainToASCII(unicode), `domainToASCII(${i + 1})`); |