summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs6
-rw-r--r--cli/tests/single_compile_with_reload.ts4
-rw-r--r--cli/tests/single_compile_with_reload.ts.out5
-rw-r--r--cli/tests/ts_import_from_js.deps.js2
-rw-r--r--cli/tests/ts_import_from_js.js4
-rw-r--r--cli/tests/ts_import_from_js.js.out2
6 files changed, 22 insertions, 1 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index c62a9a501..fafce3eb0 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -1938,6 +1938,12 @@ itest!(cjs_imports {
itest!(ts_import_from_js {
args: "run --quiet --reload ts_import_from_js.js",
output: "ts_import_from_js.js.out",
+ http_server: true,
+});
+
+itest!(single_compile_with_reload {
+ args: "run --reload --allow-read single_compile_with_reload.ts",
+ output: "single_compile_with_reload.ts.out",
});
itest!(proto_exploit {
diff --git a/cli/tests/single_compile_with_reload.ts b/cli/tests/single_compile_with_reload.ts
new file mode 100644
index 000000000..3dd728366
--- /dev/null
+++ b/cli/tests/single_compile_with_reload.ts
@@ -0,0 +1,4 @@
+await import("./005_more_imports.ts");
+console.log("1");
+await import("./005_more_imports.ts");
+console.log("2");
diff --git a/cli/tests/single_compile_with_reload.ts.out b/cli/tests/single_compile_with_reload.ts.out
new file mode 100644
index 000000000..2cdd71673
--- /dev/null
+++ b/cli/tests/single_compile_with_reload.ts.out
@@ -0,0 +1,5 @@
+Compile [WILDCARD]single_compile_with_reload.ts
+Compile [WILDCARD]005_more_imports.ts
+Hello
+1
+2
diff --git a/cli/tests/ts_import_from_js.deps.js b/cli/tests/ts_import_from_js.deps.js
new file mode 100644
index 000000000..bfea5ac79
--- /dev/null
+++ b/cli/tests/ts_import_from_js.deps.js
@@ -0,0 +1,2 @@
+import "./005_more_imports.ts";
+export { printHello } from "http://localhost:4545/cli/tests/subdir/mod2.ts";
diff --git a/cli/tests/ts_import_from_js.js b/cli/tests/ts_import_from_js.js
index e06ca15a2..f912c2723 100644
--- a/cli/tests/ts_import_from_js.js
+++ b/cli/tests/ts_import_from_js.js
@@ -1 +1,3 @@
-import "./005_more_imports.ts";
+import { printHello } from "./ts_import_from_js.deps.js";
+printHello();
+console.log("success");
diff --git a/cli/tests/ts_import_from_js.js.out b/cli/tests/ts_import_from_js.js.out
index e965047ad..e1d7a869f 100644
--- a/cli/tests/ts_import_from_js.js.out
+++ b/cli/tests/ts_import_from_js.js.out
@@ -1 +1,3 @@
Hello
+Hello
+success