test: tighten mistral media and onboarding coverage
This commit is contained in:
@@ -14,7 +14,12 @@ vi.mock("../../commands/auth-choice-options.js", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../../commands/onboard-provider-auth-flags.js", () => ({
|
||||
ONBOARD_PROVIDER_AUTH_FLAGS: [] as Array<{ cliOption: string; description: string }>,
|
||||
ONBOARD_PROVIDER_AUTH_FLAGS: [
|
||||
{
|
||||
cliOption: "--mistral-api-key <key>",
|
||||
description: "Mistral API key",
|
||||
},
|
||||
] as Array<{ cliOption: string; description: string }>,
|
||||
}));
|
||||
|
||||
vi.mock("../../commands/onboard.js", () => ({
|
||||
@@ -103,6 +108,16 @@ describe("registerOnboardCommand", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("parses --mistral-api-key and forwards mistralApiKey", async () => {
|
||||
await runCli(["onboard", "--mistral-api-key", "sk-mistral-test"]);
|
||||
expect(onboardCommandMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
mistralApiKey: "sk-mistral-test",
|
||||
}),
|
||||
runtime,
|
||||
);
|
||||
});
|
||||
|
||||
it("reports errors via runtime on onboard command failures", async () => {
|
||||
onboardCommandMock.mockRejectedValueOnce(new Error("onboard failed"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user