diff options
Diffstat (limited to 'tests/integration/pm_tests.rs')
-rw-r--r-- | tests/integration/pm_tests.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/integration/pm_tests.rs b/tests/integration/pm_tests.rs index cc5527c40..668519bdc 100644 --- a/tests/integration/pm_tests.rs +++ b/tests/integration/pm_tests.rs @@ -2,9 +2,7 @@ use deno_core::serde_json::json; use test_util::assert_contains; -use test_util::env_vars_for_jsr_tests; -// use test_util::env_vars_for_npm_tests; -// use test_util::itest; +use test_util::env_vars_for_jsr_npm_tests; use test_util::TestContextBuilder; #[test] @@ -110,21 +108,24 @@ fn add_multiple() { } #[test] -fn add_not_supported_npm() { +fn add_npm() { let context = pm_context_builder().build(); + let temp_dir = context.temp_dir().path(); - let output = context - .new_command() - .args("add @denotest/add npm:express") - .run(); - output.assert_exit_code(1); + let output = context.new_command().args("add npm:chalk@4.1").run(); + output.assert_exit_code(0); let output = output.combined_output(); - assert_contains!(output, "error: Adding npm: packages is currently not supported. Package: npm:express"); + assert_contains!(output, "Add chalk"); + temp_dir.join("deno.json").assert_matches_json(json!({ + "imports": { + "chalk": "npm:chalk@^4.1.2" + } + })); } fn pm_context_builder() -> TestContextBuilder { TestContextBuilder::new() .use_http_server() - .envs(env_vars_for_jsr_tests()) + .envs(env_vars_for_jsr_npm_tests()) .use_temp_cwd() } |