From 74e294c8c1873db447af0f02229470f8d78fffdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 24 Sep 2024 02:33:03 +0100 Subject: refactor: reenable more tests after DENO_FUTURE migration (#25752) Rewrites and reenables following tests: - `task::task_both_package_json_selected` --- tests/integration/task_tests.rs | 11 ----------- tests/specs/task/both_package_json_selected/__test__.jsonc | 10 ++++++++++ tests/specs/task/both_package_json_selected/deno.json | 6 ++++++ tests/specs/task/both_package_json_selected/install.out | 3 +++ tests/specs/task/both_package_json_selected/package.json | 9 +++++++++ .../task/both_package_json_selected/package_json_selected.out | 5 +++++ tests/testdata/task/both/deno.json | 6 ------ tests/testdata/task/both/package.json | 9 --------- tests/testdata/task/both/package_json_selected.out | 8 -------- 9 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 tests/specs/task/both_package_json_selected/__test__.jsonc create mode 100644 tests/specs/task/both_package_json_selected/deno.json create mode 100644 tests/specs/task/both_package_json_selected/install.out create mode 100644 tests/specs/task/both_package_json_selected/package.json create mode 100644 tests/specs/task/both_package_json_selected/package_json_selected.out delete mode 100644 tests/testdata/task/both/deno.json delete mode 100644 tests/testdata/task/both/package.json delete mode 100644 tests/testdata/task/both/package_json_selected.out (limited to 'tests') diff --git a/tests/integration/task_tests.rs b/tests/integration/task_tests.rs index 895e643a0..d198a3be6 100644 --- a/tests/integration/task_tests.rs +++ b/tests/integration/task_tests.rs @@ -31,17 +31,6 @@ // http_server: true, // }); -// TODO(2.0): not entirely clear what's wrong with this test -// itest!(task_both_package_json_selected { -// args: "task bin asdf", -// cwd: Some("task/both/"), -// output: "task/both/package_json_selected.out", -// copy_temp_dir: Some("task/both/"), -// 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/both_package_json_selected/__test__.jsonc b/tests/specs/task/both_package_json_selected/__test__.jsonc new file mode 100644 index 000000000..acdb7892d --- /dev/null +++ b/tests/specs/task/both_package_json_selected/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "install.out" + }, + { "args": "task bin asdf", "output": "package_json_selected.out" } + ] +} diff --git a/tests/specs/task/both_package_json_selected/deno.json b/tests/specs/task/both_package_json_selected/deno.json new file mode 100644 index 000000000..1038609a4 --- /dev/null +++ b/tests/specs/task/both_package_json_selected/deno.json @@ -0,0 +1,6 @@ +{ + "tasks": { + "output": "deno eval 'console.log(1)'", + "other": "deno eval 'console.log(2)'" + } +} diff --git a/tests/specs/task/both_package_json_selected/install.out b/tests/specs/task/both_package_json_selected/install.out new file mode 100644 index 000000000..645501a3d --- /dev/null +++ b/tests/specs/task/both_package_json_selected/install.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Initialize @denotest/bin@1.0.0 diff --git a/tests/specs/task/both_package_json_selected/package.json b/tests/specs/task/both_package_json_selected/package.json new file mode 100644 index 000000000..708ccc6b1 --- /dev/null +++ b/tests/specs/task/both_package_json_selected/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "bin": "cli-esm testing this out", + "output": "echo should never be called or shown" + }, + "dependencies": { + "other": "npm:@denotest/bin@1.0" + } +} diff --git a/tests/specs/task/both_package_json_selected/package_json_selected.out b/tests/specs/task/both_package_json_selected/package_json_selected.out new file mode 100644 index 000000000..6c42a2efb --- /dev/null +++ b/tests/specs/task/both_package_json_selected/package_json_selected.out @@ -0,0 +1,5 @@ +Task bin cli-esm testing this out "asdf" +testing +this +out +asdf diff --git a/tests/testdata/task/both/deno.json b/tests/testdata/task/both/deno.json deleted file mode 100644 index 1038609a4..000000000 --- a/tests/testdata/task/both/deno.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tasks": { - "output": "deno eval 'console.log(1)'", - "other": "deno eval 'console.log(2)'" - } -} diff --git a/tests/testdata/task/both/package.json b/tests/testdata/task/both/package.json deleted file mode 100644 index 708ccc6b1..000000000 --- a/tests/testdata/task/both/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "scripts": { - "bin": "cli-esm testing this out", - "output": "echo should never be called or shown" - }, - "dependencies": { - "other": "npm:@denotest/bin@1.0" - } -} diff --git a/tests/testdata/task/both/package_json_selected.out b/tests/testdata/task/both/package_json_selected.out deleted file mode 100644 index c72baeb64..000000000 --- a/tests/testdata/task/both/package_json_selected.out +++ /dev/null @@ -1,8 +0,0 @@ -Download http://localhost:4260/@denotest/bin -Download http://localhost:4260/@denotest/bin/1.0.0.tgz -Initialize @denotest/bin@1.0.0 -Task bin cli-esm testing this out "asdf" -testing -this -out -asdf -- cgit v1.2.3