diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-10 20:06:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 20:06:59 -0400 |
commit | 28aa489de9cd4f995ec2fc02e2c9d224e89f4c01 (patch) | |
tree | b316937a47fe9c8f9f6768bc13b9a686c07cf42f /test_util/src | |
parent | 5fd74bfa1c5ed514c3e19fdb2e8590fe251d3ee6 (diff) |
feat(compile): unstable npm and node specifier support (#19005)
This is the initial support for npm and node specifiers in `deno
compile`. The npm packages are included in the binary and read from it via
a virtual file system. This also supports the `--node-modules-dir` flag,
dependencies specified in a package.json, and npm binary commands (ex.
`deno compile --unstable npm:cowsay`)
Closes #16632
Diffstat (limited to 'test_util/src')
-rw-r--r-- | test_util/src/builders.rs | 1 | ||||
-rw-r--r-- | test_util/src/temp_dir.rs | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/test_util/src/builders.rs b/test_util/src/builders.rs index a5f192b73..33a1a98f0 100644 --- a/test_util/src/builders.rs +++ b/test_util/src/builders.rs @@ -341,6 +341,7 @@ impl TestCommandBuilder { )) } + #[track_caller] pub fn run(&self) -> TestCommandOutput { fn read_pipe_to_string(mut pipe: os_pipe::PipeReader) -> String { let mut output = String::new(); diff --git a/test_util/src/temp_dir.rs b/test_util/src/temp_dir.rs index db3c246dc..dc638c7ea 100644 --- a/test_util/src/temp_dir.rs +++ b/test_util/src/temp_dir.rs @@ -58,6 +58,10 @@ impl TempDir { fs::create_dir_all(self.path().join(path)).unwrap(); } + pub fn remove_dir_all(&self, path: impl AsRef<Path>) { + fs::remove_dir_all(self.path().join(path)).unwrap(); + } + pub fn read_to_string(&self, path: impl AsRef<Path>) -> String { let file_path = self.path().join(path); fs::read_to_string(&file_path) |