diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-06-11 12:41:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 11:41:44 +0000 |
commit | 6a356aff1380e79d67738c5b43aa2b5fee76600d (patch) | |
tree | be4aadc62a523ff280820958a1a3829f1a18ca7d /tests/node_compat/test/parallel/test-url-parse-invalid-input.js | |
parent | 3d41b486da7dcba49c8a18b45425e356c329d986 (diff) |
chore: sync up Node.js test files for v20.11.1 (#24066)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
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); + }); +} +*/ |