(host)
| 14 | } |
| 15 | |
| 16 | function test(host) { |
| 17 | ['get', 'request'].forEach((fn) => { |
| 18 | Object.keys(modules).forEach((module) => { |
| 19 | const doNotCall = common.mustNotCall( |
| 20 | `${module}.${fn} should not connect to ${host}` |
| 21 | ); |
| 22 | const throws = () => { modules[module][fn](host, doNotCall); }; |
| 23 | assert.throws(throws, { |
| 24 | name: 'TypeError', |
| 25 | code: 'ERR_INVALID_URL' |
| 26 | }); |
| 27 | }); |
| 28 | }); |
| 29 | } |
| 30 | |
| 31 | ['www.nodejs.org', 'localhost', '127.0.0.1', 'http://:80/'].forEach(test); |