diff options
Diffstat (limited to 'tests/node_compat/test/parallel/test-url-parse-invalid-input.js')
-rw-r--r-- | tests/node_compat/test/parallel/test-url-parse-invalid-input.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/node_compat/test/parallel/test-url-parse-invalid-input.js b/tests/node_compat/test/parallel/test-url-parse-invalid-input.js index 98d2d7e2d..7e8aa5c04 100644 --- a/tests/node_compat/test/parallel/test-url-parse-invalid-input.js +++ b/tests/node_compat/test/parallel/test-url-parse-invalid-input.js @@ -81,3 +81,33 @@ if (common.hasIntl) { (e) => e.code === 'ERR_INVALID_URL', 'parsing http://\u00AD/bad.com/'); } + +/* + FIXME(kt3k): node -e <script> doesn't work in deno +{ + const badURLs = [ + 'https://evil.com:.example.com', + 'git+ssh://git@github.com:npm/npm', + ]; + badURLs.forEach((badURL) => { + common.spawnPromisified(process.execPath, ['-e', `url.parse(${JSON.stringify(badURL)})`]) + .then(common.mustCall(({ code, stdout, stderr }) => { + assert.strictEqual(code, 0); + assert.strictEqual(stdout, ''); + assert.match(stderr, /\[DEP0170\] DeprecationWarning:/); + })); + }); + + // Warning should only happen once per process. + const expectedWarning = [ + `The URL ${badURLs[0]} is invalid. Future versions of Node.js will throw an error.`, + 'DEP0170', + ]; + common.expectWarning({ + DeprecationWarning: expectedWarning, + }); + badURLs.forEach((badURL) => { + url.parse(badURL); + }); +} +*/ |