mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
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:
parent
eec83898e4
commit
5004a4db52
1 changed files with 15 additions and 7 deletions
|
|
@ -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 ────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue