summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-08-06 20:35:30 +0530
committerGitHub <noreply@github.com>2024-08-06 20:35:30 +0530
commitb3f1f3ba04e51554ab59d6255bf34a79a9c42bd0 (patch)
tree6455a67387f69c01803e12bc1652eeb0f7dbf7ca /tests
parent897159dc6e1b2319cf2f5f09d8d6cecc0d3175fa (diff)
feat: deno run <task> (#24891)
This PR updates `deno run` to fallback to executing tasks when there is no script with the specified name. If there are both script and a task with the same name then `deno run` will prioritise executing the script.
Diffstat (limited to 'tests')
-rw-r--r--tests/specs/run/run_task/__test__.jsonc13
-rw-r--r--tests/specs/run/run_task/deno.json5
-rw-r--r--tests/specs/run/run_task/main.out2
-rw-r--r--tests/specs/run/run_task/main.ts1
-rw-r--r--tests/specs/run/run_task/not_found.out1
5 files changed, 22 insertions, 0 deletions
diff --git a/tests/specs/run/run_task/__test__.jsonc b/tests/specs/run/run_task/__test__.jsonc
new file mode 100644
index 000000000..0d1c82efd
--- /dev/null
+++ b/tests/specs/run/run_task/__test__.jsonc
@@ -0,0 +1,13 @@
+{
+ "tests": {
+ "deno_run_task": {
+ "args": "run main",
+ "output": "main.out"
+ },
+ "deno_run_module_task_not_found": {
+ "args": "run not_found",
+ "output": "not_found.out",
+ "exitCode": 1
+ }
+ }
+}
diff --git a/tests/specs/run/run_task/deno.json b/tests/specs/run/run_task/deno.json
new file mode 100644
index 000000000..54772504e
--- /dev/null
+++ b/tests/specs/run/run_task/deno.json
@@ -0,0 +1,5 @@
+{
+ "tasks": {
+ "main": "deno run main.ts"
+ }
+}
diff --git a/tests/specs/run/run_task/main.out b/tests/specs/run/run_task/main.out
new file mode 100644
index 000000000..f946c4a79
--- /dev/null
+++ b/tests/specs/run/run_task/main.out
@@ -0,0 +1,2 @@
+Task main deno run main.ts
+main
diff --git a/tests/specs/run/run_task/main.ts b/tests/specs/run/run_task/main.ts
new file mode 100644
index 000000000..6c2ee34f3
--- /dev/null
+++ b/tests/specs/run/run_task/main.ts
@@ -0,0 +1 @@
+console.log("main");
diff --git a/tests/specs/run/run_task/not_found.out b/tests/specs/run/run_task/not_found.out
new file mode 100644
index 000000000..5d3bba059
--- /dev/null
+++ b/tests/specs/run/run_task/not_found.out
@@ -0,0 +1 @@
+error: Module not found "file:///[WILDCARD]/not_found".