diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-07-26 18:52:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 22:52:31 +0000 |
commit | 56e3daa19b1a0718bbcea2beae737ce8845ceac2 (patch) | |
tree | 408138bea1dc2641b6f2ce75a6497322d27222b8 /test_util | |
parent | 0e4d6d41ad64b89ab72d87a778d1bf3e516efabc (diff) |
fix(lsp): handle import mapped `node:` specifier (#19956)
Closes https://github.com/denoland/vscode_deno/issues/805
Diffstat (limited to 'test_util')
-rw-r--r-- | test_util/src/builders.rs | 19 | ||||
-rw-r--r-- | test_util/src/lsp.rs | 3 |
2 files changed, 4 insertions, 18 deletions
diff --git a/test_util/src/builders.rs b/test_util/src/builders.rs index bdc5efbe0..f9c546c6f 100644 --- a/test_util/src/builders.rs +++ b/test_util/src/builders.rs @@ -29,7 +29,6 @@ use crate::TempDir; pub struct TestContextBuilder { use_http_server: bool, use_temp_cwd: bool, - use_separate_deno_dir: bool, use_symlinked_temp_dir: bool, /// Copies the files at the specified directory in the "testdata" directory /// to the temp folder and runs the test from there. This is useful when @@ -77,15 +76,6 @@ impl TestContextBuilder { self } - /// By default, the temp_dir and the deno_dir will be shared. - /// In some cases, that might cause an issue though, so calling - /// this will use a separate directory for the deno dir and the - /// temp directory. - pub fn use_separate_deno_dir(mut self) -> Self { - self.use_separate_deno_dir = true; - self - } - /// Copies the files at the specified directory in the "testdata" directory /// to the temp folder and runs the test from there. This is useful when /// the test creates files in the testdata directory (ex. a node_modules folder) @@ -127,11 +117,7 @@ impl TestContextBuilder { .clone() .unwrap_or_else(std::env::temp_dir); let deno_dir = TempDir::new_in(&temp_dir_path); - let temp_dir = if self.use_separate_deno_dir { - TempDir::new_in(&temp_dir_path) - } else { - deno_dir.clone() - }; + let temp_dir = TempDir::new_in(&temp_dir_path); let temp_dir = if self.use_symlinked_temp_dir { TempDir::new_symlinked(temp_dir) } else { @@ -535,10 +521,11 @@ impl TestCommandOutput { &self.testdata_dir } - pub fn skip_output_check(&self) { + pub fn skip_output_check(&self) -> &Self { *self.asserted_combined.borrow_mut() = true; *self.asserted_stdout.borrow_mut() = true; *self.asserted_stderr.borrow_mut() = true; + self } pub fn skip_exit_code_check(&self) { diff --git a/test_util/src/lsp.rs b/test_util/src/lsp.rs index 59f67e3d9..81ebd3c47 100644 --- a/test_util/src/lsp.rs +++ b/test_util/src/lsp.rs @@ -6,7 +6,6 @@ use crate::PathRef; use crate::TestContext; use crate::TestContextBuilder; -use super::new_deno_dir; use super::TempDir; use anyhow::Result; @@ -524,7 +523,7 @@ impl LspClientBuilder { } pub fn build_result(&self) -> Result<LspClient> { - let deno_dir = new_deno_dir(); + let deno_dir = self.context.as_ref().unwrap().deno_dir().clone(); let mut command = Command::new(&self.deno_exe); command .env("DENO_DIR", deno_dir.path()) |