summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-10-26 07:17:58 +1100
committerGitHub <noreply@github.com>2020-10-26 07:17:58 +1100
commit3d19fb493b82a8ab9b3fd0fa923fc81fd68acb4e (patch)
tree8080a1f05c43c972db1a0ecbc0a39ed74c78f419 /cli/tests
parent95854b88ad4a67afb885322c70bb424352bca49e (diff)
fix(cli): properly handle roots with extensions that don't match media type (#8114)
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/cache_extensionless.out2
-rw-r--r--cli/tests/cache_random_extension.out2
-rw-r--r--cli/tests/integration_tests.rs12
-rw-r--r--cli/tests/subdir/no_js_ext3
4 files changed, 19 insertions, 0 deletions
diff --git a/cli/tests/cache_extensionless.out b/cli/tests/cache_extensionless.out
new file mode 100644
index 000000000..6e3569689
--- /dev/null
+++ b/cli/tests/cache_extensionless.out
@@ -0,0 +1,2 @@
+[WILDCARD]
+Check http://localhost:4545/cli/tests/subdir/no_js_ext
diff --git a/cli/tests/cache_random_extension.out b/cli/tests/cache_random_extension.out
new file mode 100644
index 000000000..c508fbc60
--- /dev/null
+++ b/cli/tests/cache_random_extension.out
@@ -0,0 +1,2 @@
+[WILDCARD]
+Check http://localhost:4545/cli/tests/subdir/no_js_ext@1.0.0
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index d88309cb2..74fac3ab1 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -2722,6 +2722,18 @@ itest!(_053_import_compression {
http_server: true,
});
+itest!(cache_extensionless {
+ args: "cache --reload http://localhost:4545/cli/tests/subdir/no_js_ext",
+ output: "cache_extensionless.out",
+ http_server: true,
+});
+
+itest!(cache_random_extension {
+ args: "cache --reload http://localhost:4545/cli/tests/subdir/no_js_ext@1.0.0",
+ output: "cache_random_extension.out",
+ http_server: true,
+});
+
itest!(cafile_url_imports {
args: "run --quiet --reload --cert tls/RootCA.pem cafile_url_imports.ts",
output: "cafile_url_imports.ts.out",
diff --git a/cli/tests/subdir/no_js_ext b/cli/tests/subdir/no_js_ext
new file mode 100644
index 000000000..8322a106f
--- /dev/null
+++ b/cli/tests/subdir/no_js_ext
@@ -0,0 +1,3 @@
+// @ts-check
+import { printHello } from "./mod2.ts";
+printHello();