mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 16:39:50 +00:00
test: Remove always-pass conditional guards in icon-integrity tests (#2214)
The `if (parsed.success)` and `if (id in SOURCES)` guards inside test bodies were redundant — an `expect(...).toBe(true)` assertion always precedes them, so the inner expects would only be skipped if the test was already failing. Replace with early-return guards that make the control flow explicit and remove the nested indirection. Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
02931cfa32
commit
475a1772a7
1 changed files with 19 additions and 14 deletions
|
|
@ -63,20 +63,23 @@ describe("Icon Integrity", () => {
|
|||
it(`${id} manifest icon URL ends with .png`, () => {
|
||||
const parsed = v.safeParse(IconEntry, manifest.agents[id]);
|
||||
expect(parsed.success).toBe(true);
|
||||
if (parsed.success) {
|
||||
expect(parsed.output.icon).toEndWith(`${id}.png`);
|
||||
if (!parsed.success) {
|
||||
return;
|
||||
}
|
||||
expect(parsed.output.icon).toEndWith(`${id}.png`);
|
||||
});
|
||||
|
||||
it(`${id} .sources.json ext is "png"`, () => {
|
||||
expect(id in AGENT_SOURCES).toBe(true);
|
||||
if (id in AGENT_SOURCES) {
|
||||
const parsed = v.safeParse(SourceEntry, AGENT_SOURCES[id]);
|
||||
expect(parsed.success).toBe(true);
|
||||
if (parsed.success) {
|
||||
expect(parsed.output.ext).toBe("png");
|
||||
}
|
||||
if (!(id in AGENT_SOURCES)) {
|
||||
return;
|
||||
}
|
||||
const parsed = v.safeParse(SourceEntry, AGENT_SOURCES[id]);
|
||||
expect(parsed.success).toBe(true);
|
||||
if (!parsed.success) {
|
||||
return;
|
||||
}
|
||||
expect(parsed.output.ext).toBe("png");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -111,13 +114,15 @@ describe("Icon Integrity", () => {
|
|||
|
||||
it(`${id} .sources.json ext is "png"`, () => {
|
||||
expect(id in CLOUD_SOURCES).toBe(true);
|
||||
if (id in CLOUD_SOURCES) {
|
||||
const src = v.safeParse(SourceEntry, CLOUD_SOURCES[id]);
|
||||
expect(src.success).toBe(true);
|
||||
if (src.success) {
|
||||
expect(src.output.ext).toBe("png");
|
||||
}
|
||||
if (!(id in CLOUD_SOURCES)) {
|
||||
return;
|
||||
}
|
||||
const src = v.safeParse(SourceEntry, CLOUD_SOURCES[id]);
|
||||
expect(src.success).toBe(true);
|
||||
if (!src.success) {
|
||||
return;
|
||||
}
|
||||
expect(src.output.ext).toBe("png");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue