diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-02-23 10:58:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 10:58:10 -0500 |
commit | 344317ec501fa124f0c74b44035fa4516999dce6 (patch) | |
tree | 3a0e4ca3d83b1a47a0903f08648ef1b896b32195 /cli/tests/integration | |
parent | 214bdbbc2b09ab3f56f0ffe1ad5930d48ec0c76f (diff) |
feat(npm): support bare specifiers from package.json in more subcommands and language server (#17891)
Diffstat (limited to 'cli/tests/integration')
-rw-r--r-- | cli/tests/integration/bench_tests.rs | 11 | ||||
-rw-r--r-- | cli/tests/integration/cache_tests.rs | 12 | ||||
-rw-r--r-- | cli/tests/integration/check_tests.rs | 22 | ||||
-rw-r--r-- | cli/tests/integration/info_tests.rs | 11 | ||||
-rw-r--r-- | cli/tests/integration/npm_tests.rs | 20 | ||||
-rw-r--r-- | cli/tests/integration/test_tests.rs | 11 |
6 files changed, 87 insertions, 0 deletions
diff --git a/cli/tests/integration/bench_tests.rs b/cli/tests/integration/bench_tests.rs index 15a86ee9d..5a010ec62 100644 --- a/cli/tests/integration/bench_tests.rs +++ b/cli/tests/integration/bench_tests.rs @@ -2,6 +2,7 @@ use deno_core::url::Url; use test_util as util; +use util::env_vars_for_npm_tests; itest!(overloads { args: "bench bench/overloads.ts", @@ -216,3 +217,13 @@ fn file_protocol() { }) .run(); } + +itest!(package_json_basic { + args: "bench", + output: "package_json/basic/main.bench.out", + envs: env_vars_for_npm_tests(), + http_server: true, + cwd: Some("package_json/basic"), + copy_temp_dir: Some("package_json/basic"), + exit_code: 0, +}); diff --git a/cli/tests/integration/cache_tests.rs b/cli/tests/integration/cache_tests.rs index ae4dc001a..c80f7f5c8 100644 --- a/cli/tests/integration/cache_tests.rs +++ b/cli/tests/integration/cache_tests.rs @@ -1,5 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +use test_util::env_vars_for_npm_tests; + itest!(_036_import_map_fetch { args: "cache --quiet --reload --import-map=import_maps/import_map.json import_maps/test.ts", @@ -95,3 +97,13 @@ itest!(json_import { // should not error args: "cache --quiet cache/json_import/main.ts", }); + +itest!(package_json_basic { + args: "cache main.ts", + output: "package_json/basic/main.cache.out", + envs: env_vars_for_npm_tests(), + http_server: true, + cwd: Some("package_json/basic"), + copy_temp_dir: Some("package_json/basic"), + exit_code: 0, +}); diff --git a/cli/tests/integration/check_tests.rs b/cli/tests/integration/check_tests.rs index 66433f81d..021a536c4 100644 --- a/cli/tests/integration/check_tests.rs +++ b/cli/tests/integration/check_tests.rs @@ -3,6 +3,8 @@ use std::process::Command; use std::process::Stdio; use test_util as util; +use util::env_vars_for_npm_tests; +use util::env_vars_for_npm_tests_no_sync_download; use util::TempDir; itest!(_095_check_with_bare_import { @@ -229,3 +231,23 @@ fn ts_no_recheck_on_redirect() { assert!(std::str::from_utf8(&output.stderr).unwrap().is_empty()); } + +itest!(package_json_basic { + args: "check main.ts", + output: "package_json/basic/main.check.out", + envs: env_vars_for_npm_tests(), + http_server: true, + cwd: Some("package_json/basic"), + copy_temp_dir: Some("package_json/basic"), + exit_code: 0, +}); + +itest!(package_json_fail_check { + args: "check --quiet fail_check.ts", + output: "package_json/basic/fail_check.check.out", + envs: env_vars_for_npm_tests_no_sync_download(), + http_server: true, + cwd: Some("package_json/basic"), + copy_temp_dir: Some("package_json/basic"), + exit_code: 1, +}); diff --git a/cli/tests/integration/info_tests.rs b/cli/tests/integration/info_tests.rs index 6c75deea6..704aaa7af 100644 --- a/cli/tests/integration/info_tests.rs +++ b/cli/tests/integration/info_tests.rs @@ -2,6 +2,7 @@ use test_util as util; use test_util::TempDir; +use util::env_vars_for_npm_tests_no_sync_download; #[test] fn info_with_compiled_source() { @@ -127,3 +128,13 @@ itest!(with_config_override { args: "info info/with_config/test.ts --config info/with_config/deno-override.json --import-map info/with_config/import_map.json", output: "info/with_config/with_config.out", }); + +itest!(package_json_basic { + args: "info --quiet main.ts", + output: "package_json/basic/main.info.out", + envs: env_vars_for_npm_tests_no_sync_download(), + http_server: true, + cwd: Some("package_json/basic"), + copy_temp_dir: Some("package_json/basic"), + exit_code: 0, +}); diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index 54053710e..910936ac3 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -1565,3 +1565,23 @@ itest!(create_require { envs: env_vars_for_npm_tests(), http_server: true, }); + +itest!(node_modules_import_run { + args: "run --quiet main.ts", + output: "npm/node_modules_import/main.out", + envs: env_vars_for_npm_tests(), + http_server: true, + cwd: Some("npm/node_modules_import/"), + copy_temp_dir: Some("npm/node_modules_import/"), + exit_code: 0, +}); + +itest!(node_modules_import_check { + args: "check --quiet main.ts", + output: "npm/node_modules_import/main_check.out", + envs: env_vars_for_npm_tests(), + http_server: true, + cwd: Some("npm/node_modules_import/"), + copy_temp_dir: Some("npm/node_modules_import/"), + exit_code: 1, +}); diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index efe50ac16..8b318e8e1 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -2,6 +2,7 @@ use deno_core::url::Url; use test_util as util; +use util::env_vars_for_npm_tests; #[test] fn no_color() { @@ -452,3 +453,13 @@ itest!(parallel_output { output: "test/parallel_output.out", exit_code: 1, }); + +itest!(package_json_basic { + args: "test", + output: "package_json/basic/main.test.out", + envs: env_vars_for_npm_tests(), + http_server: true, + cwd: Some("package_json/basic"), + copy_temp_dir: Some("package_json/basic"), + exit_code: 0, +}); |