node/test/parallel/test-url-format-invalid-input.js
Joyee Cheung 78545039d6 test: remove unnecessary eslint-disable max-len
PR-URL: https://github.com/nodejs/node/pull/11049
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-30 10:19:44 -08:00

20 lines
413 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const url = require('url');
// https://github.com/nodejs/node/pull/1036
const throws = [
undefined,
null,
true,
false,
0,
function() {}
];
for (let i = 0; i < throws.length; i++) {
assert.throws(function() { url.format(throws[i]); }, TypeError);
}
assert.strictEqual(url.format(''), '');
assert.strictEqual(url.format({}), '');