Skip to content

Commit

Permalink
fix: don't normalize additional arguments in vr command
Browse files Browse the repository at this point in the history
- update cliffy to v0.19.3 to fix the bug
- add test for forwarding options
  • Loading branch information
c4spar committed Jul 17, 2021
1 parent d827cde commit 07505e2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 14 additions & 2 deletions cli_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ const cliArgs = [
];
const expectedOutput = "Works!";

async function runScript(name: string, wd: string = yamlWd): Promise<string> {
async function runScript(
name: string,
wd: string = yamlWd,
additionalArgs: Array<string> = [],
): Promise<string> {
const process = Deno.run({
cmd: [...cliArgs, name],
cmd: [...cliArgs, name, ...additionalArgs],
cwd: wd,
stdout: "piped",
});
Expand Down Expand Up @@ -86,3 +90,11 @@ Deno.test("--help", async () => {
const output = await runScript("--help");
assertStringIncludes(output, "--version");
});

Deno.test("forward arguments", async () => {
const output = await runScript("forward", yamlWd, ["--shuffle=1234"]);
assertStringIncludes(
output.replace(/\r\n|\r|\n/g, " "),
"deno test --lock=lock.json --cached-only --shuffle=1234",
);
});
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export {
CompletionsCommand,
StringType,
ValidationError,
} from "https://deno.land/x/cliffy@v0.19.1/command/mod.ts";
} from "https://deno.land/x/cliffy@v0.19.3/command/mod.ts";
export { kill } from "https://deno.land/x/process@v0.3.0/mod.ts";
export {
DenoLand,
Expand Down
2 changes: 2 additions & 0 deletions test/yaml/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ scripts:
importmap:
cmd: deno run --unstable imap.ts
imap: importmap.json
forward:
cmd: echo deno test --lock=lock.json --cached-only

0 comments on commit 07505e2

Please sign in to comment.