Skip to content
Merged
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: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"lock": false,
"tasks": {
"test": "deno test --allow-run=deno",
"test:node": "deno task build:npm 0.0.0 && node test/main/node.mjs",
"test:node": "deno task build:npm 0.0.0 && node test/main/node.mjs hello world",
"build:npm": "deno run -A tasks/build-npm.ts"
},
"lint": {
Expand Down
2 changes: 1 addition & 1 deletion lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function main(
//@ts-expect-error type-checked by Deno, run on Node
process.on("SIGINT", interrupt);
//@ts-expect-error type-checked by Deno, run on Node
yield* body(global.process.argv.slice());
yield* body(global.process.argv.slice(2));
} finally {
//@ts-expect-error this runs on Node
process.off("SIGINT", interrupt);
Expand Down
5 changes: 4 additions & 1 deletion test/main/node.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { main } from "../../build/npm/esm/mod.js";

await main(function* () {
await main(function* ([hello, world]) {
if (hello !== "hello" && world !== "world") {
throw new Error("arguments were not properly passed to main operation");
}
console.log("hello world");
});