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