summaryrefslogtreecommitdiff
path: root/cli/tests/integration/run_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r--cli/tests/integration/run_tests.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index 0e1516cc3..3a19564a3 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -2867,6 +2867,44 @@ fn package_json_error_dep_value_test() {
.assert_matches_file("package_json/invalid_value/task.out");
}
+#[test]
+fn package_json_no_node_modules_dir_created() {
+ // it should not create a node_modules directory
+ let context = TestContextBuilder::new()
+ .add_npm_env_vars()
+ .use_temp_cwd()
+ .build();
+ let temp_dir = context.deno_dir();
+
+ temp_dir.write("deno.json", "{}");
+ temp_dir.write("package.json", "{}");
+ temp_dir.write("main.ts", "");
+
+ context.new_command().args("run main.ts").run();
+
+ assert!(!temp_dir.path().join("node_modules").exists());
+}
+
+#[test]
+fn node_modules_dir_no_npm_specifiers_no_dir_created() {
+ // it should not create a node_modules directory
+ let context = TestContextBuilder::new()
+ .add_npm_env_vars()
+ .use_temp_cwd()
+ .build();
+ let temp_dir = context.deno_dir();
+
+ temp_dir.write("deno.json", "{}");
+ temp_dir.write("main.ts", "");
+
+ context
+ .new_command()
+ .args("run --node-modules-dir main.ts")
+ .run();
+
+ assert!(!temp_dir.path().join("node_modules").exists());
+}
+
itest!(wasm_streaming_panic_test {
args: "run run/wasm_streaming_panic_test.js",
output: "run/wasm_streaming_panic_test.js.out",