summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-23 11:39:48 -0400
committerGitHub <noreply@github.com>2024-05-23 15:39:48 +0000
commit143ea4759fa32bcd32ff983caeaec08929a52e80 (patch)
treeb233ff92f0c8da00a3f74ba795298f69923ea213 /tests/specs
parent0b8deca08b9257c41055b4f34ebdaf1459b2de89 (diff)
feat(task): run `npm run` commands with Deno more often (#23794)
Closes #23036
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/task/npm_run/__test__.jsonc17
-rw-r--r--tests/specs/task/npm_run/deno.jsonc11
-rw-r--r--tests/specs/task/npm_run/package.json5
-rw-r--r--tests/specs/task/npm_run/task_npm_run.out2
-rw-r--r--tests/specs/task/npm_run/task_test.out3
-rw-r--r--tests/specs/task/npm_run/task_test_using_npm.out3
6 files changed, 41 insertions, 0 deletions
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]