From 7b509e492ed6c7ace0f3860c3f4e8e7be3452fda Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Fri, 4 Oct 2024 15:26:13 +0530 Subject: tests: enable package_json_node_modules_none (#25825) Co-authored-by: David Sherret --- tests/integration/task_tests.rs | 13 ------------- .../task/package_json_node_modules_dir_none/__test__.jsonc | 6 ++++++ tests/specs/task/package_json_node_modules_dir_none/bin.out | 8 ++++++++ .../specs/task/package_json_node_modules_dir_none/deno.json | 3 +++ .../task/package_json_node_modules_dir_none/package.json | 9 +++++++++ .../task/package_json_node_modules_dir_false/bin.out | 2 -- .../task/package_json_node_modules_dir_false/deno.json | 3 --- .../task/package_json_node_modules_dir_false/package.json | 9 --------- tools/lint.js | 2 +- 9 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 tests/specs/task/package_json_node_modules_dir_none/__test__.jsonc create mode 100644 tests/specs/task/package_json_node_modules_dir_none/bin.out create mode 100644 tests/specs/task/package_json_node_modules_dir_none/deno.json create mode 100644 tests/specs/task/package_json_node_modules_dir_none/package.json delete mode 100644 tests/testdata/task/package_json_node_modules_dir_false/bin.out delete mode 100644 tests/testdata/task/package_json_node_modules_dir_false/deno.json delete mode 100644 tests/testdata/task/package_json_node_modules_dir_false/package.json diff --git a/tests/integration/task_tests.rs b/tests/integration/task_tests.rs index d198a3be6..56bab2970 100644 --- a/tests/integration/task_tests.rs +++ b/tests/integration/task_tests.rs @@ -18,19 +18,6 @@ // http_server: true, // }); -// TODO(2.0): decide what to do with this test -// should not auto-install the packages in the package.json -// when using nodeModulesDir: false -// itest!(task_package_json_node_modules_dir_false { -// args: "task echo", -// cwd: Some("task/package_json_node_modules_dir_false/"), -// output: "task/package_json_node_modules_dir_false/bin.out", -// copy_temp_dir: Some("task/package_json_node_modules_dir_false/"), -// envs: env_vars_for_npm_tests(), -// exit_code: 0, -// http_server: true, -// }); - // TODO(2.0): not entirely clear what's wrong with this test but it hangs for more than 60s // itest!(task_npx_on_own { // args: "task on-own", diff --git a/tests/specs/task/package_json_node_modules_dir_none/__test__.jsonc b/tests/specs/task/package_json_node_modules_dir_none/__test__.jsonc new file mode 100644 index 000000000..21d9d73ba --- /dev/null +++ b/tests/specs/task/package_json_node_modules_dir_none/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "tempDir": true, + "args": "task echo", + "output": "bin.out", + "exitCode": 0 +} diff --git a/tests/specs/task/package_json_node_modules_dir_none/bin.out b/tests/specs/task/package_json_node_modules_dir_none/bin.out new file mode 100644 index 000000000..c86261d9e --- /dev/null +++ b/tests/specs/task/package_json_node_modules_dir_none/bin.out @@ -0,0 +1,8 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://localhost:4260/@denotest/bin/0.5.0.tgz +[UNORDERED_END] +Task echo deno eval 'console.log(1)' && cli-esm hi +1 +hi diff --git a/tests/specs/task/package_json_node_modules_dir_none/deno.json b/tests/specs/task/package_json_node_modules_dir_none/deno.json new file mode 100644 index 000000000..38af4024b --- /dev/null +++ b/tests/specs/task/package_json_node_modules_dir_none/deno.json @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "none" +} diff --git a/tests/specs/task/package_json_node_modules_dir_none/package.json b/tests/specs/task/package_json_node_modules_dir_none/package.json new file mode 100644 index 000000000..713a9dc5b --- /dev/null +++ b/tests/specs/task/package_json_node_modules_dir_none/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "echo": "deno eval 'console.log(1)' && cli-esm hi" + }, + "dependencies": { + "@denotest/bin": "0.5", + "other": "npm:@denotest/bin@1.0" + } +} diff --git a/tests/testdata/task/package_json_node_modules_dir_false/bin.out b/tests/testdata/task/package_json_node_modules_dir_false/bin.out deleted file mode 100644 index d5d59d551..000000000 --- a/tests/testdata/task/package_json_node_modules_dir_false/bin.out +++ /dev/null @@ -1,2 +0,0 @@ -Task echo deno eval 'console.log(1)' -1 diff --git a/tests/testdata/task/package_json_node_modules_dir_false/deno.json b/tests/testdata/task/package_json_node_modules_dir_false/deno.json deleted file mode 100644 index 23a325cfc..000000000 --- a/tests/testdata/task/package_json_node_modules_dir_false/deno.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "nodeModulesDir": false -} diff --git a/tests/testdata/task/package_json_node_modules_dir_false/package.json b/tests/testdata/task/package_json_node_modules_dir_false/package.json deleted file mode 100644 index 081e076b9..000000000 --- a/tests/testdata/task/package_json_node_modules_dir_false/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "scripts": { - "echo": "deno eval 'console.log(1)'" - }, - "dependencies": { - "@denotest/bin": "0.5", - "other": "npm:@denotest/bin@1.0" - } -} diff --git a/tools/lint.js b/tools/lint.js index edf800c4e..1f3f56498 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -220,7 +220,7 @@ async function ensureNoNewITests() { "repl_tests.rs": 0, "run_tests.rs": 331, "shared_library_tests.rs": 0, - "task_tests.rs": 3, + "task_tests.rs": 2, "test_tests.rs": 0, "upgrade_tests.rs": 0, "vendor_tests.rs": 1, -- cgit v1.2.3