Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/bin_shebang_project/dir/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env -S NO_COLOR=true deno run
console.log("Hello!");
2 changes: 1 addition & 1 deletion tests/bin_shebang_project/main.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/local/bin/node
#!/usr/bin/env -S NO_COLOR=true deno run --unstable-raw-imports --no-config --allow-env --allow-net=jsr.io:443
console.log("Hello!");
26 changes: 21 additions & 5 deletions tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,18 @@ Deno.test("should build bin project", async () => {

Deno.test("should build bin project with a shebang", async () => {
await runTest("bin_shebang_project", {
entryPoints: [{
kind: "bin",
name: "hello",
path: "./main.ts",
}],
entryPoints: [
{
kind: "bin",
name: "hello",
path: "./main.ts",
},
{
kind: "bin",
name: "hellodir",
path: "./dir/main.ts",
},
],
shims: getAllShimOptions(false),
outDir: "./npm",
package: {
Expand All @@ -416,6 +423,7 @@ Deno.test("should build bin project with a shebang", async () => {
version: "1.0.0",
bin: {
hello: "./esm/main.js",
hellodir: "./esm/dir/main.js",
},
scripts: {
test: "node test_runner.js",
Expand All @@ -431,6 +439,14 @@ Deno.test("should build bin project with a shebang", async () => {
output.getFileText("script/main.js"),
expectedText,
);
assertEquals(
output.getFileText("script/dir/main.js"),
expectedText,
);
assertEquals(
output.getFileText("esm/dir/main.js"),
expectedText,
);
assertEquals(
output.getFileText("esm/main.js"),
expectedText,
Expand Down
Loading