Skip to content

Commit

Permalink
test(command,prompt): fix tests (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar authored May 13, 2024
1 parent ff14148 commit fe9726d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions command/test/command/generic_types_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { assert, IsAny, IsExact } from "conditional_type_checks";
new Command<any>()
.action((options, ...args) => {
assert<IsAny<typeof options>>(true);
assert<IsAny<typeof args>>(true);
// deno-lint-ignore no-explicit-any
assert<IsExact<typeof args, Array<any>>>(true);
});
},
});
Expand All @@ -26,7 +27,8 @@ import { assert, IsAny, IsExact } from "conditional_type_checks";
.env("FOO_BAR <val:number>", "")
.action((options, ...args) => {
assert<IsAny<typeof options>>(true);
assert<IsAny<typeof args>>(true);
// deno-lint-ignore no-explicit-any
assert<IsExact<typeof args, Array<any>>>(true);
});
},
});
Expand Down
14 changes: 8 additions & 6 deletions testing/snapshot_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ Deno.test({
"--update",
];

const cmd = new Deno.Command("deno", {
args,
env: {
CLIFFY_SNAPSHOT_CONFIG: Deno.env.get("CLIFFY_SNAPSHOT_CONFIG"),
},
});
const env: Record<string, string> = {};

const snapshotConfig = Deno.env.get("CLIFFY_SNAPSHOT_CONFIG");
if (snapshotConfig) {
env.CLIFFY_SNAPSHOT_CONFIG = snapshotConfig;
}

const cmd = new Deno.Command("deno", { args, env });

const { success, stdout, stderr } = await cmd.output();

Expand Down

0 comments on commit fe9726d

Please sign in to comment.