summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-06-22 01:45:41 +0200
committerGitHub <noreply@github.com>2021-06-22 01:45:41 +0200
commit9105892ec8b454571c56883eace557eee25b3301 (patch)
tree965d90e3a885c2f870f58eef921d8811a9a491b9 /cli/tests
parenta5eb2dfc93afc2899ed6e1ad2b3e029157889f7c (diff)
refactor: unify JavaScript script execution method (#11043)
This commit renames "JsRuntime::execute" to "JsRuntime::execute_script". Additionally same renames were applied to methods on "deno_runtime::Worker" and "deno_runtime::WebWorker". A new macro was added to "deno_core" called "located_script_name" which returns the name of Rust file alongside line no and col no of that call site. This macro is useful in combination with "JsRuntime::execute_script" and allows to provide accurate place where "one-off" JavaScript scripts are executed for internal runtime functions. Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/dont_panic_not_found_cwd.ts3
-rw-r--r--cli/tests/integration_tests.rs19
2 files changed, 0 insertions, 22 deletions
diff --git a/cli/tests/dont_panic_not_found_cwd.ts b/cli/tests/dont_panic_not_found_cwd.ts
deleted file mode 100644
index e5ae1dfa4..000000000
--- a/cli/tests/dont_panic_not_found_cwd.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-const dir = Deno.makeTempDirSync();
-Deno.chdir(dir);
-Deno.removeSync(dir);
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index af3c9167c..2cad5a44c 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -5635,25 +5635,6 @@ console.log("finish");
assert!(stderr.contains("BadResource"));
}
- #[cfg(not(windows))]
- #[test]
- fn should_not_panic_on_not_found_cwd() {
- let output = util::deno_cmd()
- .current_dir(util::root_path())
- .arg("run")
- .arg("--allow-write")
- .arg("--allow-read")
- .arg("cli/tests/dont_panic_not_found_cwd.ts")
- .stderr(std::process::Stdio::piped())
- .spawn()
- .unwrap()
- .wait_with_output()
- .unwrap();
- assert!(!output.status.success());
- let stderr = std::str::from_utf8(&output.stderr).unwrap().trim();
- assert!(stderr.contains("Failed to get current working directory"));
- }
-
#[cfg(windows)]
// Clippy suggests to remove the `NoStd` prefix from all variants. I disagree.
#[allow(clippy::enum_variant_names)]