summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorFenix <zhuzhenfeng1993@hotmail.com>2023-01-04 00:19:28 +0800
committerGitHub <noreply@github.com>2023-01-03 16:19:28 +0000
commit501472f06ba52d46611bd1ffd8bf4fe9de94425d (patch)
treeda7ed8162becc75d5e848033341f74f610db3ff2 /cli/tests
parent7716449d41bef9c41b8de7e16341cbe8b253a6da (diff)
fix(cli): bundle command support shebang file (#17113)
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/bundle_tests.rs5
-rw-r--r--cli/tests/testdata/bundle/shebang_file.bundle.out10
-rw-r--r--cli/tests/testdata/subdir/shebang_file.js5
3 files changed, 20 insertions, 0 deletions
diff --git a/cli/tests/bundle_tests.rs b/cli/tests/bundle_tests.rs
index 99144a866..75b345a9f 100644
--- a/cli/tests/bundle_tests.rs
+++ b/cli/tests/bundle_tests.rs
@@ -470,4 +470,9 @@ mod bundle {
http_server: true,
exit_code: 1,
});
+
+ itest!(bundle_shebang_file {
+ args: "bundle subdir/shebang_file.js",
+ output: "bundle/shebang_file.bundle.out",
+ });
}
diff --git a/cli/tests/testdata/bundle/shebang_file.bundle.out b/cli/tests/testdata/bundle/shebang_file.bundle.out
new file mode 100644
index 000000000..1be80b68c
--- /dev/null
+++ b/cli/tests/testdata/bundle/shebang_file.bundle.out
@@ -0,0 +1,10 @@
+[WILDCARD]
+#!/usr/bin/env -S deno run --allow-read
+// deno-fmt-ignore-file
+// deno-lint-ignore-file
+// This code was bundled using `deno bundle` and it's not recommended to edit it manually
+
+for (const item of Deno.readDirSync(".")){
+ console.log(item.name);
+}
+
diff --git a/cli/tests/testdata/subdir/shebang_file.js b/cli/tests/testdata/subdir/shebang_file.js
new file mode 100644
index 000000000..1c81be31c
--- /dev/null
+++ b/cli/tests/testdata/subdir/shebang_file.js
@@ -0,0 +1,5 @@
+#!/usr/bin/env -S deno run --allow-read
+
+for (const item of Deno.readDirSync(".")) {
+ console.log(item.name);
+}