summaryrefslogtreecommitdiff
path: root/tests/specs/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/cache')
-rw-r--r--tests/specs/cache/check_local_by_default/__test__.jsonc4
-rw-r--r--tests/specs/cache/check_local_by_default/check_local_by_default.out0
-rw-r--r--tests/specs/cache/check_local_by_default/check_local_by_default.ts3
-rw-r--r--tests/specs/cache/check_local_by_default2/__test__.jsonc4
-rw-r--r--tests/specs/cache/check_local_by_default2/check_local_by_default2.out0
-rw-r--r--tests/specs/cache/check_local_by_default2/check_local_by_default2.ts6
-rw-r--r--tests/specs/cache/extensionless/__test__.jsonc4
-rw-r--r--tests/specs/cache/extensionless/cache_extensionless.out2
-rw-r--r--tests/specs/cache/fetch_multiple/__test__.jsonc4
-rw-r--r--tests/specs/cache/fetch_multiple/fetch_multiple.out5
-rw-r--r--tests/specs/cache/fetch_multiple/other.ts1
-rw-r--r--tests/specs/cache/fetch_multiple/test.ts1
-rw-r--r--tests/specs/cache/ignore_require/__test__.jsonc4
-rw-r--r--tests/specs/cache/ignore_require/ignore_require.js2
-rw-r--r--tests/specs/cache/json_import/__test__.jsonc5
-rw-r--r--tests/specs/cache/json_import/main.ts2
-rw-r--r--tests/specs/cache/json_import/test.json5
-rw-r--r--tests/specs/cache/package_json/__test__.jsonc5
-rw-r--r--tests/specs/cache/package_json/lib.ts9
-rw-r--r--tests/specs/cache/package_json/main.cache.out3
-rw-r--r--tests/specs/cache/package_json/main.ts3
-rw-r--r--tests/specs/cache/package_json/package.json5
-rw-r--r--tests/specs/cache/performance_stats/__test__.jsonc4
-rw-r--r--tests/specs/cache/performance_stats/hello.ts1
-rw-r--r--tests/specs/cache/performance_stats/performance_stats.out16
-rw-r--r--tests/specs/cache/random_extension/__test__.jsonc4
-rw-r--r--tests/specs/cache/random_extension/cache_random_extension.out2
-rw-r--r--tests/specs/cache/redirect/__test__.jsonc4
-rw-r--r--tests/specs/cache/redirect/redirect_cache.out5
-rw-r--r--tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts1
-rw-r--r--tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out2
-rw-r--r--tests/specs/cache/with_bare_import/__test__.jsonc5
32 files changed, 121 insertions, 0 deletions
diff --git a/tests/specs/cache/check_local_by_default/__test__.jsonc b/tests/specs/cache/check_local_by_default/__test__.jsonc
new file mode 100644
index 000000000..e6d0829fd
--- /dev/null
+++ b/tests/specs/cache/check_local_by_default/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --quiet check_local_by_default.ts",
+ "output": "check_local_by_default.out"
+}
diff --git a/tests/specs/cache/check_local_by_default/check_local_by_default.out b/tests/specs/cache/check_local_by_default/check_local_by_default.out
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/cache/check_local_by_default/check_local_by_default.out
diff --git a/tests/specs/cache/check_local_by_default/check_local_by_default.ts b/tests/specs/cache/check_local_by_default/check_local_by_default.ts
new file mode 100644
index 000000000..2ae8c2692
--- /dev/null
+++ b/tests/specs/cache/check_local_by_default/check_local_by_default.ts
@@ -0,0 +1,3 @@
+import * as a from "http://localhost:4545/subdir/type_error.ts";
+
+console.log(a.a);
diff --git a/tests/specs/cache/check_local_by_default2/__test__.jsonc b/tests/specs/cache/check_local_by_default2/__test__.jsonc
new file mode 100644
index 000000000..a9e70dcd9
--- /dev/null
+++ b/tests/specs/cache/check_local_by_default2/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --quiet check_local_by_default2.ts",
+ "output": "check_local_by_default2.out"
+}
diff --git a/tests/specs/cache/check_local_by_default2/check_local_by_default2.out b/tests/specs/cache/check_local_by_default2/check_local_by_default2.out
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/cache/check_local_by_default2/check_local_by_default2.out
diff --git a/tests/specs/cache/check_local_by_default2/check_local_by_default2.ts b/tests/specs/cache/check_local_by_default2/check_local_by_default2.ts
new file mode 100644
index 000000000..5177ff944
--- /dev/null
+++ b/tests/specs/cache/check_local_by_default2/check_local_by_default2.ts
@@ -0,0 +1,6 @@
+import * as a from "http://localhost:4545/subdir/type_error.ts";
+
+const b: "b" = 12;
+
+console.log(a.a);
+console.log(b);
diff --git a/tests/specs/cache/extensionless/__test__.jsonc b/tests/specs/cache/extensionless/__test__.jsonc
new file mode 100644
index 000000000..837f26ecc
--- /dev/null
+++ b/tests/specs/cache/extensionless/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --reload --check=all http://localhost:4545/subdir/no_js_ext",
+ "output": "cache_extensionless.out"
+}
diff --git a/tests/specs/cache/extensionless/cache_extensionless.out b/tests/specs/cache/extensionless/cache_extensionless.out
new file mode 100644
index 000000000..3694c67cb
--- /dev/null
+++ b/tests/specs/cache/extensionless/cache_extensionless.out
@@ -0,0 +1,2 @@
+[WILDCARD]
+Check http://localhost:4545/subdir/no_js_ext
diff --git a/tests/specs/cache/fetch_multiple/__test__.jsonc b/tests/specs/cache/fetch_multiple/__test__.jsonc
new file mode 100644
index 000000000..a5cf41113
--- /dev/null
+++ b/tests/specs/cache/fetch_multiple/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --reload --check=all test.ts other.ts",
+ "output": "fetch_multiple.out"
+}
diff --git a/tests/specs/cache/fetch_multiple/fetch_multiple.out b/tests/specs/cache/fetch_multiple/fetch_multiple.out
new file mode 100644
index 000000000..1cd3639ec
--- /dev/null
+++ b/tests/specs/cache/fetch_multiple/fetch_multiple.out
@@ -0,0 +1,5 @@
+Download http://localhost:4545/subdir/mod2.ts
+Download http://localhost:4545/subdir/mt_text_typescript.t1.ts
+Download http://localhost:4545/subdir/print_hello.ts
+Check [WILDCARD]/fetch_multiple/test.ts
+Check [WILDCARD]/fetch_multiple/other.ts
diff --git a/tests/specs/cache/fetch_multiple/other.ts b/tests/specs/cache/fetch_multiple/other.ts
new file mode 100644
index 000000000..91fe376b3
--- /dev/null
+++ b/tests/specs/cache/fetch_multiple/other.ts
@@ -0,0 +1 @@
+import "http://localhost:4545/subdir/mt_text_typescript.t1.ts";
diff --git a/tests/specs/cache/fetch_multiple/test.ts b/tests/specs/cache/fetch_multiple/test.ts
new file mode 100644
index 000000000..baa52775d
--- /dev/null
+++ b/tests/specs/cache/fetch_multiple/test.ts
@@ -0,0 +1 @@
+import "http://localhost:4545/subdir/mod2.ts";
diff --git a/tests/specs/cache/ignore_require/__test__.jsonc b/tests/specs/cache/ignore_require/__test__.jsonc
new file mode 100644
index 000000000..e6d0093c7
--- /dev/null
+++ b/tests/specs/cache/ignore_require/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --reload --no-check ignore_require.js",
+ "output": ""
+}
diff --git a/tests/specs/cache/ignore_require/ignore_require.js b/tests/specs/cache/ignore_require/ignore_require.js
new file mode 100644
index 000000000..a8ef15021
--- /dev/null
+++ b/tests/specs/cache/ignore_require/ignore_require.js
@@ -0,0 +1,2 @@
+// deno-lint-ignore-file
+require("invalid module specifier");
diff --git a/tests/specs/cache/json_import/__test__.jsonc b/tests/specs/cache/json_import/__test__.jsonc
new file mode 100644
index 000000000..fdc3459c3
--- /dev/null
+++ b/tests/specs/cache/json_import/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ // should not error
+ "args": "cache --quiet main.ts",
+ "output": "[WILDCARD]"
+}
diff --git a/tests/specs/cache/json_import/main.ts b/tests/specs/cache/json_import/main.ts
new file mode 100644
index 000000000..78273558f
--- /dev/null
+++ b/tests/specs/cache/json_import/main.ts
@@ -0,0 +1,2 @@
+import asdf from "./test.json" assert { type: "json" };
+console.log(asdf);
diff --git a/tests/specs/cache/json_import/test.json b/tests/specs/cache/json_import/test.json
new file mode 100644
index 000000000..258849a68
--- /dev/null
+++ b/tests/specs/cache/json_import/test.json
@@ -0,0 +1,5 @@
+{
+ "foo": {
+ "bar": 1
+ }
+}
diff --git a/tests/specs/cache/package_json/__test__.jsonc b/tests/specs/cache/package_json/__test__.jsonc
new file mode 100644
index 000000000..b25ac147d
--- /dev/null
+++ b/tests/specs/cache/package_json/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "tempDir": true,
+ "args": "cache main.ts",
+ "output": "main.cache.out"
+}
diff --git a/tests/specs/cache/package_json/lib.ts b/tests/specs/cache/package_json/lib.ts
new file mode 100644
index 000000000..1deed81f7
--- /dev/null
+++ b/tests/specs/cache/package_json/lib.ts
@@ -0,0 +1,9 @@
+import * as test from "@denotest/esm-basic";
+
+export function add(a: number, b: number) {
+ return a + b;
+}
+
+export function getValue() {
+ return test.getValue();
+}
diff --git a/tests/specs/cache/package_json/main.cache.out b/tests/specs/cache/package_json/main.cache.out
new file mode 100644
index 000000000..1c729e2a3
--- /dev/null
+++ b/tests/specs/cache/package_json/main.cache.out
@@ -0,0 +1,3 @@
+Download http://localhost:4545/npm/registry/@denotest/esm-basic
+Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz
+Initialize @denotest/esm-basic@1.0.0
diff --git a/tests/specs/cache/package_json/main.ts b/tests/specs/cache/package_json/main.ts
new file mode 100644
index 000000000..e241f3002
--- /dev/null
+++ b/tests/specs/cache/package_json/main.ts
@@ -0,0 +1,3 @@
+import { getValue } from "./lib.ts";
+
+console.log(getValue());
diff --git a/tests/specs/cache/package_json/package.json b/tests/specs/cache/package_json/package.json
new file mode 100644
index 000000000..54ca824d6
--- /dev/null
+++ b/tests/specs/cache/package_json/package.json
@@ -0,0 +1,5 @@
+{
+ "dependencies": {
+ "@denotest/esm-basic": "*"
+ }
+}
diff --git a/tests/specs/cache/performance_stats/__test__.jsonc b/tests/specs/cache/performance_stats/__test__.jsonc
new file mode 100644
index 000000000..f4d37b803
--- /dev/null
+++ b/tests/specs/cache/performance_stats/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --reload --check=all --log-level debug hello.ts",
+ "output": "performance_stats.out"
+}
diff --git a/tests/specs/cache/performance_stats/hello.ts b/tests/specs/cache/performance_stats/hello.ts
new file mode 100644
index 000000000..accefceba
--- /dev/null
+++ b/tests/specs/cache/performance_stats/hello.ts
@@ -0,0 +1 @@
+console.log("Hello World");
diff --git a/tests/specs/cache/performance_stats/performance_stats.out b/tests/specs/cache/performance_stats/performance_stats.out
new file mode 100644
index 000000000..141829ee6
--- /dev/null
+++ b/tests/specs/cache/performance_stats/performance_stats.out
@@ -0,0 +1,16 @@
+[WILDCARD]
+DEBUG RS - [WILDCARD] - Compilation statistics:
+ Files: [WILDCARD]
+ Nodes: [WILDCARD]
+ Identifiers: [WILDCARD]
+ Symbols: [WILDCARD]
+ Types: [WILDCARD]
+ Instantiations: [WILDCARD]
+ Parse time: [WILDCARD]
+ Bind time: [WILDCARD]
+ Check time: [WILDCARD]
+ Emit time: [WILDCARD]
+ Total TS time: [WILDCARD]
+ Compile time: [WILDCARD]
+
+[WILDCARD]
diff --git a/tests/specs/cache/random_extension/__test__.jsonc b/tests/specs/cache/random_extension/__test__.jsonc
new file mode 100644
index 000000000..7b847a77d
--- /dev/null
+++ b/tests/specs/cache/random_extension/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --reload --check=all http://localhost:4545/subdir/no_js_ext@1.0.0",
+ "output": "cache_random_extension.out"
+}
diff --git a/tests/specs/cache/random_extension/cache_random_extension.out b/tests/specs/cache/random_extension/cache_random_extension.out
new file mode 100644
index 000000000..745a2e0e3
--- /dev/null
+++ b/tests/specs/cache/random_extension/cache_random_extension.out
@@ -0,0 +1,2 @@
+[WILDCARD]
+Check http://localhost:4545/subdir/no_js_ext@1.0.0
diff --git a/tests/specs/cache/redirect/__test__.jsonc b/tests/specs/cache/redirect/__test__.jsonc
new file mode 100644
index 000000000..251bc6174
--- /dev/null
+++ b/tests/specs/cache/redirect/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "cache --reload --check=all http://localhost:4548/subdir/redirects/a.ts",
+ "output": "redirect_cache.out"
+}
diff --git a/tests/specs/cache/redirect/redirect_cache.out b/tests/specs/cache/redirect/redirect_cache.out
new file mode 100644
index 000000000..8905c4529
--- /dev/null
+++ b/tests/specs/cache/redirect/redirect_cache.out
@@ -0,0 +1,5 @@
+Download http://localhost:4548/subdir/redirects/a.ts
+Download http://localhost:4546/subdir/redirects/a.ts
+Download http://localhost:4545/subdir/redirects/a.ts
+Download http://localhost:4545/subdir/redirects/b.ts
+Check http://localhost:4548/subdir/redirects/a.ts
diff --git a/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts
new file mode 100644
index 000000000..c0748305d
--- /dev/null
+++ b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts
@@ -0,0 +1 @@
+import "foo";
diff --git a/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out
new file mode 100644
index 000000000..2668a6e08
--- /dev/null
+++ b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out
@@ -0,0 +1,2 @@
+[WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../
+ at file:///[WILDCARD]/095_cache_with_bare_import.ts:[WILDCARD]
diff --git a/tests/specs/cache/with_bare_import/__test__.jsonc b/tests/specs/cache/with_bare_import/__test__.jsonc
new file mode 100644
index 000000000..0ff2d09cb
--- /dev/null
+++ b/tests/specs/cache/with_bare_import/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "cache 095_cache_with_bare_import.ts",
+ "output": "095_cache_with_bare_import.ts.out",
+ "exitCode": 1
+}