test: replace loose cloud-type count assertion with enumerated known-set check (#2709)

The "should have a reasonable number of distinct cloud types" test used
toBeGreaterThanOrEqual(2) and toBeLessThanOrEqual(10) — bounds so wide
they would never catch a real type-naming mistake. Replace it with an
explicit allowlist check so adding an unknown type fails immediately.

Current valid types (api, cli, local) are all in the set; vm, container,
sandbox, and cloud are pre-approved to avoid blocking planned additions.

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-17 09:55:15 -07:00 committed by GitHub
parent eec83898e4
commit 5004a4db52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,18 +209,26 @@ describe("Cloud type values", () => {
validTypes.add(cloud.type);
}
it("should have a reasonable number of distinct cloud types", () => {
// There should be a few types (vm, cloud, container, sandbox, local, etc.)
// but not so many that it's disorganized
expect(validTypes.size).toBeGreaterThanOrEqual(2);
expect(validTypes.size).toBeLessThanOrEqual(10);
});
it("cloud types should be lowercase", () => {
for (const type of validTypes) {
expect(type).toBe(type.toLowerCase());
}
});
it("all cloud types should be from the known set", () => {
const knownTypes = new Set([
"api",
"cli",
"local",
"vm",
"container",
"sandbox",
"cloud",
]);
for (const [key, cloud] of allClouds) {
expect(knownTypes, `cloud "${key}" has unknown type "${cloud.type}"`).toContain(cloud.type);
}
});
});
// ── Env var interpolation patterns ────────────────────────────────────────