summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/lsp/registries.rs9
-rw-r--r--cli/tests/node_compat/config.json4
-rw-r--r--cli/tests/node_compat/test/parallel/test-http-url.parse-auth.js55
-rw-r--r--cli/tests/node_compat/test/parallel/test-http-url.parse-path.js53
-rw-r--r--cli/tests/node_compat/test/parallel/test-http-url.parse-post.js61
-rw-r--r--cli/tests/node_compat/test/parallel/test-http-url.parse-search.js54
6 files changed, 5 insertions, 231 deletions
diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs
index c1fa815e9..d5bdd22ca 100644
--- a/cli/lsp/registries.rs
+++ b/cli/lsp/registries.rs
@@ -1675,16 +1675,17 @@ mod tests {
let module_registry =
ModuleRegistry::new(&location, HttpClient::new(None, None).unwrap())
.unwrap();
- let result = module_registry.check_origin("https://deno.com").await;
+ let result = module_registry.check_origin("https://example.com").await;
assert!(result.is_err());
let err = result.unwrap_err().to_string();
- assert!(err
- .contains("https://deno.com/.well-known/deno-import-intellisense.json"));
+ assert!(err.contains(
+ "https://example.com/.well-known/deno-import-intellisense.json"
+ ));
// because we are caching an empty file when we hit an error with import
// detection when fetching the config file, we should have an error now that
// indicates trying to parse an empty file.
- let result = module_registry.check_origin("https://deno.com").await;
+ let result = module_registry.check_origin("https://example.com").await;
assert!(result.is_err());
let err = result.unwrap_err().to_string();
assert!(err.contains("EOF while parsing a value at line 1 column 0"));
diff --git a/cli/tests/node_compat/config.json b/cli/tests/node_compat/config.json
index 90e7edcd4..43d9862b3 100644
--- a/cli/tests/node_compat/config.json
+++ b/cli/tests/node_compat/config.json
@@ -347,10 +347,6 @@
"test-http-outgoing-message-inheritance.js",
"test-http-outgoing-renderHeaders.js",
"test-http-outgoing-settimeout.js",
- "test-http-url.parse-auth.js",
- "test-http-url.parse-path.js",
- "test-http-url.parse-post.js",
- "test-http-url.parse-search.js",
"test-net-access-byteswritten.js",
"test-net-better-error-messages-listen-path.js",
"test-net-better-error-messages-path.js",
diff --git a/cli/tests/node_compat/test/parallel/test-http-url.parse-auth.js b/cli/tests/node_compat/test/parallel/test-http-url.parse-auth.js
deleted file mode 100644
index baaea7c76..000000000
--- a/cli/tests/node_compat/test/parallel/test-http-url.parse-auth.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// deno-fmt-ignore-file
-// deno-lint-ignore-file
-
-// Copyright Joyent and Node contributors. All rights reserved. MIT license.
-// Taken from Node 18.12.1
-// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually
-
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-require('../common');
-const assert = require('assert');
-const http = require('http');
-const url = require('url');
-
-function check(request) {
- // The correct authorization header is be passed
- assert.strictEqual(request.headers.authorization, 'Basic dXNlcjpwYXNzOg==');
-}
-
-const server = http.createServer(function(request, response) {
- // Run the check function
- check(request);
- response.writeHead(200, {});
- response.end('ok');
- server.close();
-});
-
-server.listen(0, function() {
- const port = this.address().port;
- // username = "user", password = "pass:"
- const testURL = url.parse(`http://user:pass%3A@localhost:${port}`);
-
- // make the request
- http.request(testURL).end();
-});
diff --git a/cli/tests/node_compat/test/parallel/test-http-url.parse-path.js b/cli/tests/node_compat/test/parallel/test-http-url.parse-path.js
deleted file mode 100644
index 7587caa2a..000000000
--- a/cli/tests/node_compat/test/parallel/test-http-url.parse-path.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// deno-fmt-ignore-file
-// deno-lint-ignore-file
-
-// Copyright Joyent and Node contributors. All rights reserved. MIT license.
-// Taken from Node 18.12.1
-// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually
-
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-require('../common');
-const assert = require('assert');
-const http = require('http');
-const url = require('url');
-
-function check(request) {
- // A path should come over
- assert.strictEqual(request.url, '/asdf');
-}
-
-const server = http.createServer(function(request, response) {
- // Run the check function
- check(request);
- response.writeHead(200, {});
- response.end('ok');
- server.close();
-});
-
-server.listen(0, function() {
- const testURL = url.parse(`http://localhost:${this.address().port}/asdf`);
-
- // make the request
- http.request(testURL).end();
-});
diff --git a/cli/tests/node_compat/test/parallel/test-http-url.parse-post.js b/cli/tests/node_compat/test/parallel/test-http-url.parse-post.js
deleted file mode 100644
index 2e461cc33..000000000
--- a/cli/tests/node_compat/test/parallel/test-http-url.parse-post.js
+++ /dev/null
@@ -1,61 +0,0 @@
-// deno-fmt-ignore-file
-// deno-lint-ignore-file
-
-// Copyright Joyent and Node contributors. All rights reserved. MIT license.
-// Taken from Node 18.12.1
-// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually
-
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-require('../common');
-const assert = require('assert');
-const http = require('http');
-const url = require('url');
-
-let testURL;
-
-function check(request) {
- // url.parse should not mess with the method
- assert.strictEqual(request.method, 'POST');
- // Everything else should be right
- assert.strictEqual(request.url, '/asdf?qwer=zxcv');
- // The host header should use the url.parse.hostname
- assert.strictEqual(request.headers.host,
- `${testURL.hostname}:${testURL.port}`);
-}
-
-const server = http.createServer(function(request, response) {
- // Run the check function
- check(request);
- response.writeHead(200, {});
- response.end('ok');
- server.close();
-});
-
-server.listen(0, function() {
- testURL = url.parse(`http://localhost:${this.address().port}/asdf?qwer=zxcv`);
- testURL.method = 'POST';
-
- // make the request
- http.request(testURL).end();
-});
diff --git a/cli/tests/node_compat/test/parallel/test-http-url.parse-search.js b/cli/tests/node_compat/test/parallel/test-http-url.parse-search.js
deleted file mode 100644
index 60304c657..000000000
--- a/cli/tests/node_compat/test/parallel/test-http-url.parse-search.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// deno-fmt-ignore-file
-// deno-lint-ignore-file
-
-// Copyright Joyent and Node contributors. All rights reserved. MIT license.
-// Taken from Node 18.12.1
-// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually
-
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-require('../common');
-const assert = require('assert');
-const http = require('http');
-const url = require('url');
-
-function check(request) {
- // A path should come over with params
- assert.strictEqual(request.url, '/asdf?qwer=zxcv');
-}
-
-const server = http.createServer(function(request, response) {
- // Run the check function
- check(request);
- response.writeHead(200, {});
- response.end('ok');
- server.close();
-});
-
-server.listen(0, function() {
- const port = this.address().port;
- const testURL = url.parse(`http://localhost:${port}/asdf?qwer=zxcv`);
-
- // make the request
- http.request(testURL).end();
-});