Skip to content

Commit f2a541d

Browse files
committed
Tighten runner test cast
The runner regression test still needs to construct a synthetic parsed value, but it can assert the parameter type expected by toCliProgram instead of bypassing type checking with never. #808 (comment) Assisted-by: Codex:gpt-5.5
1 parent 6638904 commit f2a541d

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

packages/cli/src/runner.test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ test("runCli does not expose the selected static command marker", async () => {
2424

2525
test("toCliProgram runs commands with stripped values", async () => {
2626
let receivedValue: Record<string, unknown> | undefined;
27-
const program = toCliProgram({
28-
command: "fake",
29-
port: 3000,
30-
ignoreConfig: true,
31-
debug: false,
32-
__fedifyCliSelectedCommand: { path: ["fake"] },
33-
__fedifyCliRunCommand: (value: Record<string, unknown>) => {
34-
receivedValue = value;
35-
},
36-
} as never);
27+
const program = toCliProgram(
28+
{
29+
command: "fake",
30+
port: 3000,
31+
ignoreConfig: true,
32+
debug: false,
33+
__fedifyCliSelectedCommand: { path: ["fake"] },
34+
__fedifyCliRunCommand: (value: Record<string, unknown>) => {
35+
receivedValue = value;
36+
},
37+
} as unknown as Parameters<typeof toCliProgram>[0],
38+
);
3739
await program.run();
3840

3941
assert.ok(receivedValue != null);

0 commit comments

Comments
 (0)