test: guard cli null helpers

This commit is contained in:
Peter Steinberger
2026-05-11 21:07:47 +01:00
parent e986012043
commit e19c7ab95e
8 changed files with 36 additions and 22 deletions

View File

@@ -1872,7 +1872,9 @@ describe("capability cli", () => {
argv: ["capability", "model", "auth", "logout", "--provider", "openai", "--json"],
});
expect(updatedStore).not.toBeNull();
if (updatedStore === null) {
throw new Error("expected updated auth store");
}
const storeSnapshot = updatedStore as unknown as Record<string, any>;
expect(storeSnapshot.profiles).toEqual({
"anthropic:default": { id: "anthropic:default" },