summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/npm/byonm_run_npm/__test__.jsonc30
-rw-r--r--tests/specs/npm/byonm_run_npm/deno.json2
-rw-r--r--tests/specs/npm/byonm_run_npm/not_in_deps.out8
-rw-r--r--tests/specs/npm/byonm_run_npm/overwrite.ts4
-rw-r--r--tests/specs/npm/byonm_run_npm/package.json4
5 files changed, 48 insertions, 0 deletions
diff --git a/tests/specs/npm/byonm_run_npm/__test__.jsonc b/tests/specs/npm/byonm_run_npm/__test__.jsonc
new file mode 100644
index 000000000..4f0b21b0f
--- /dev/null
+++ b/tests/specs/npm/byonm_run_npm/__test__.jsonc
@@ -0,0 +1,30 @@
+{
+ "tests": {
+ "not_in_deps": {
+ "steps": [{
+ "args": "run -A --quiet npm:cowsay moo",
+ "output": "not_in_deps.out"
+ }, {
+ // ensure it doesn't make any lockfile modifications and thus doesn't write to the lockfile
+ "args": [
+ "eval",
+ "try { Deno.statSync('deno.lock') } catch (e) { console.log(e instanceof Deno.errors.NotFound); }"
+ ],
+ "output": "true\n"
+ }]
+ },
+ "in_deps": {
+ "tempDir": true,
+ "steps": [{
+ "args": "install npm:cowsay",
+ "output": "[WILDCARD]"
+ }, {
+ "args": "run --allow-write overwrite.ts",
+ "output": "[WILDCARD]"
+ }, {
+ "args": "run -A npm:cowsay moo",
+ "output": "replaced\n"
+ }]
+ }
+ }
+}
diff --git a/tests/specs/npm/byonm_run_npm/deno.json b/tests/specs/npm/byonm_run_npm/deno.json
new file mode 100644
index 000000000..2c63c0851
--- /dev/null
+++ b/tests/specs/npm/byonm_run_npm/deno.json
@@ -0,0 +1,2 @@
+{
+}
diff --git a/tests/specs/npm/byonm_run_npm/not_in_deps.out b/tests/specs/npm/byonm_run_npm/not_in_deps.out
new file mode 100644
index 000000000..dc07eb43e
--- /dev/null
+++ b/tests/specs/npm/byonm_run_npm/not_in_deps.out
@@ -0,0 +1,8 @@
+ _____
+< moo >
+ -----
+ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||
diff --git a/tests/specs/npm/byonm_run_npm/overwrite.ts b/tests/specs/npm/byonm_run_npm/overwrite.ts
new file mode 100644
index 000000000..3749c5e4e
--- /dev/null
+++ b/tests/specs/npm/byonm_run_npm/overwrite.ts
@@ -0,0 +1,4 @@
+Deno.writeTextFileSync(
+ "node_modules/cowsay/cli.js",
+ "console.log('replaced');",
+);
diff --git a/tests/specs/npm/byonm_run_npm/package.json b/tests/specs/npm/byonm_run_npm/package.json
new file mode 100644
index 000000000..9664f260a
--- /dev/null
+++ b/tests/specs/npm/byonm_run_npm/package.json
@@ -0,0 +1,4 @@
+{
+ "dependencies": {
+ }
+}