From 143ea4759fa32bcd32ff983caeaec08929a52e80 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 23 May 2024 11:39:48 -0400 Subject: feat(task): run `npm run` commands with Deno more often (#23794) Closes #23036 --- tests/specs/task/npm_run/__test__.jsonc | 17 +++++++++++++++++ tests/specs/task/npm_run/deno.jsonc | 11 +++++++++++ tests/specs/task/npm_run/package.json | 5 +++++ tests/specs/task/npm_run/task_npm_run.out | 2 ++ tests/specs/task/npm_run/task_test.out | 3 +++ tests/specs/task/npm_run/task_test_using_npm.out | 3 +++ 6 files changed, 41 insertions(+) create mode 100644 tests/specs/task/npm_run/__test__.jsonc create mode 100644 tests/specs/task/npm_run/deno.jsonc create mode 100644 tests/specs/task/npm_run/package.json create mode 100644 tests/specs/task/npm_run/task_npm_run.out create mode 100644 tests/specs/task/npm_run/task_test.out create mode 100644 tests/specs/task/npm_run/task_test_using_npm.out (limited to 'tests') diff --git a/tests/specs/task/npm_run/__test__.jsonc b/tests/specs/task/npm_run/__test__.jsonc new file mode 100644 index 000000000..b6cb249b8 --- /dev/null +++ b/tests/specs/task/npm_run/__test__.jsonc @@ -0,0 +1,17 @@ +{ + "tests": { + "uses_deno_no_flags": { + "args": "task test", + "output": "task_test.out" + }, + "uses_npm_flags": { + "args": "task test_using_npm", + "output": "task_test_using_npm.out", + "exitCode": 1 + }, + "npm_run": { + "args": "task npm_run", + "output": "task_npm_run.out" + } + } +} diff --git a/tests/specs/task/npm_run/deno.jsonc b/tests/specs/task/npm_run/deno.jsonc new file mode 100644 index 000000000..bd6dde873 --- /dev/null +++ b/tests/specs/task/npm_run/deno.jsonc @@ -0,0 +1,11 @@ +{ + "tasks": { + "echo": "echo 'Hello, World!'", + // should use the task from package.json and not the one above + "test": "npm run echo hi there", + // currently this will execute using the actual `npm run` because we + // haven't implemented the flags for `npm run` yet + "test_using_npm": "npm run non_existent -- --ignore-scripts", + "npm_run": "npm run" + } +} diff --git a/tests/specs/task/npm_run/package.json b/tests/specs/task/npm_run/package.json new file mode 100644 index 000000000..0e0f53354 --- /dev/null +++ b/tests/specs/task/npm_run/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "echo": "echo" + } +} diff --git a/tests/specs/task/npm_run/task_npm_run.out b/tests/specs/task/npm_run/task_npm_run.out new file mode 100644 index 000000000..b623e30b0 --- /dev/null +++ b/tests/specs/task/npm_run/task_npm_run.out @@ -0,0 +1,2 @@ +Task npm_run npm run +Scripts available [WILDCARD] \ No newline at end of file diff --git a/tests/specs/task/npm_run/task_test.out b/tests/specs/task/npm_run/task_test.out new file mode 100644 index 000000000..f3d7398d9 --- /dev/null +++ b/tests/specs/task/npm_run/task_test.out @@ -0,0 +1,3 @@ +Task test npm run echo hi there +Task echo echo "hi" "there" +hi there diff --git a/tests/specs/task/npm_run/task_test_using_npm.out b/tests/specs/task/npm_run/task_test_using_npm.out new file mode 100644 index 000000000..4bf8fc612 --- /dev/null +++ b/tests/specs/task/npm_run/task_test_using_npm.out @@ -0,0 +1,3 @@ +Task test_using_npm npm run non_existent -- --ignore-scripts +npm [WILDLINE] Missing script: "non_existent" +[WILDCARD] -- cgit v1.2.3