summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-09-14 16:41:47 +0200
committerGitHub <noreply@github.com>2022-09-14 10:41:47 -0400
commit7b982829930bfcfbb70d0bb377f90939d122efed (patch)
tree01c49fa78d8dbadbce770bb4be60899d2f0349eb /cli/tests/testdata
parent6a9acc81420a5e87e61de48b25af85d961e35730 (diff)
fix(npm): binary entrypoint for .js or no extension (#15900)
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/npm/deno_run_cjs.out4
-rw-r--r--cli/tests/testdata/npm/deno_run_no_ext.out4
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-cjs.js5
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-no-ext5
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli.mjs (renamed from cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/cli.mjs)0
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json9
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/package.json5
7 files changed, 27 insertions, 5 deletions
diff --git a/cli/tests/testdata/npm/deno_run_cjs.out b/cli/tests/testdata/npm/deno_run_cjs.out
new file mode 100644
index 000000000..ffe7cbd89
--- /dev/null
+++ b/cli/tests/testdata/npm/deno_run_cjs.out
@@ -0,0 +1,4 @@
+this
+is
+a
+test
diff --git a/cli/tests/testdata/npm/deno_run_no_ext.out b/cli/tests/testdata/npm/deno_run_no_ext.out
new file mode 100644
index 000000000..ffe7cbd89
--- /dev/null
+++ b/cli/tests/testdata/npm/deno_run_no_ext.out
@@ -0,0 +1,4 @@
+this
+is
+a
+test
diff --git a/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-cjs.js b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-cjs.js
new file mode 100644
index 000000000..7b6ba2724
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-cjs.js
@@ -0,0 +1,5 @@
+const process = require("process");
+
+for (const arg of process.argv.slice(2)) {
+ console.log(arg);
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-no-ext b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-no-ext
new file mode 100644
index 000000000..7b6ba2724
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli-no-ext
@@ -0,0 +1,5 @@
+const process = require("process");
+
+for (const arg of process.argv.slice(2)) {
+ console.log(arg);
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/cli.mjs b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli.mjs
index 0ae8e9190..0ae8e9190 100644
--- a/cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/cli.mjs
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/cli.mjs
diff --git a/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json
new file mode 100644
index 000000000..78a1abff2
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/bin/1.0.0/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "@deno/bin",
+ "version": "1.0.0",
+ "bin": {
+ "cli-esm": "./cli.mjs",
+ "cli-no-ext": "./cli-no-ext",
+ "cli-cjs": "./cli-cjs.js"
+ }
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/package.json
deleted file mode 100644
index ecd0d24a7..000000000
--- a/cli/tests/testdata/npm/registry/@denotest/esm-bin/1.0.0/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "@deno/esm-bin",
- "version": "1.0.0",
- "bin": "./cli.mjs"
-}