mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: tighten root output assertions
This commit is contained in:
@@ -32,9 +32,10 @@ describe("appcast.xml", () => {
|
|||||||
expect(items.length).toBeGreaterThan(0);
|
expect(items.length).toBeGreaterThan(0);
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
expect(item.shortVersion, item.raw).not.toBeNull();
|
if (item.shortVersion === null || item.sparkleVersion === null) {
|
||||||
expect(item.sparkleVersion, item.raw).not.toBeNull();
|
throw new Error(`Appcast entry missing version fields: ${item.raw}`);
|
||||||
expect(item.sparkleVersion).toBe(canonicalSparkleBuildFromVersion(item.shortVersion!));
|
}
|
||||||
|
expect(item.sparkleVersion).toBe(canonicalSparkleBuildFromVersion(item.shortVersion));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -34,14 +34,10 @@ describe("cli json stdout contract", () => {
|
|||||||
const stdout = result.stdout.trim();
|
const stdout = result.stdout.trim();
|
||||||
expect(stdout.length).toBeGreaterThan(0);
|
expect(stdout.length).toBeGreaterThan(0);
|
||||||
const parsed = JSON.parse(stdout) as unknown;
|
const parsed = JSON.parse(stdout) as unknown;
|
||||||
expect(typeof parsed).toBe("object");
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
||||||
expect(parsed).not.toBeNull();
|
throw new Error(`Expected JSON object stdout, got: ${stdout}`);
|
||||||
expect(Array.isArray(parsed)).toBe(false);
|
}
|
||||||
expect(Object.keys(parsed as Record<string, unknown>).sort()).toEqual([
|
expect(Object.keys(parsed).sort()).toEqual(["availability", "channel", "update"]);
|
||||||
"availability",
|
|
||||||
"channel",
|
|
||||||
"update",
|
|
||||||
]);
|
|
||||||
expect(stdout).not.toContain("Doctor warnings");
|
expect(stdout).not.toContain("Doctor warnings");
|
||||||
expect(stdout).not.toContain("Doctor changes");
|
expect(stdout).not.toContain("Doctor changes");
|
||||||
expect(stdout).not.toContain("Config invalid");
|
expect(stdout).not.toContain("Config invalid");
|
||||||
|
|||||||
Reference in New Issue
Block a user