mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
test: remove duplicate and theatrical tests (#2643)
- aws.test.ts: remove "all bundles have required fields" test that used
toBeTruthy() on id/label — fully redundant with the more specific
"bundle IDs follow naming convention" (/_3_0$/) and "labels include
pricing info" ($, /mo) tests below it.
- commands-cloud-info.test.ts: consolidate 3 separate tests for
"cloud with no implemented agents" that each fetched the same manifest,
called cmdCloudInfo("emptycloud"), and checked different assertions on
identical output into a single test.
- credential-hints.test.ts: merge "reports credentials appear set..."
and "lists the env var names when all are set" — identical setup (same
env vars, same function call) with overlapping assertions split across
two tests for no good reason.
Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: L <6723574+louisgv@users.noreply.github.com>
This commit is contained in:
parent
d8ab5c4724
commit
9af0c7b606
3 changed files with 2 additions and 32 deletions
|
|
@ -154,13 +154,6 @@ describe("aws/aws", () => {
|
|||
expect(BUNDLES.length).toBeGreaterThanOrEqual(5);
|
||||
});
|
||||
|
||||
it("all bundles have required fields", () => {
|
||||
for (const b of BUNDLES) {
|
||||
expect(b.id).toBeTruthy();
|
||||
expect(b.label).toBeTruthy();
|
||||
}
|
||||
});
|
||||
|
||||
it("bundle IDs follow naming convention", () => {
|
||||
for (const b of BUNDLES) {
|
||||
expect(b.id).toMatch(/_3_0$/);
|
||||
|
|
|
|||
|
|
@ -164,31 +164,15 @@ describe("cmdCloudInfo", () => {
|
|||
// ── Cloud with no implemented agents ──────────────────────────────
|
||||
|
||||
describe("cloud with no implemented agents", () => {
|
||||
it("should show no-agents message", async () => {
|
||||
it("shows cloud name, no-agents message, and notes for agent-less cloud", async () => {
|
||||
global.fetch = mock(async () => new Response(JSON.stringify(manifestWithNotes)));
|
||||
await loadManifest(true);
|
||||
|
||||
await cmdCloudInfo("emptycloud");
|
||||
const output = consoleMocks.log.mock.calls.map((c: unknown[]) => c.join(" ")).join("\n");
|
||||
expect(output).toContain("No implemented agents");
|
||||
});
|
||||
|
||||
it("should still show cloud name for agent-less cloud", async () => {
|
||||
global.fetch = mock(async () => new Response(JSON.stringify(manifestWithNotes)));
|
||||
await loadManifest(true);
|
||||
|
||||
await cmdCloudInfo("emptycloud");
|
||||
const output = consoleMocks.log.mock.calls.map((c: unknown[]) => c.join(" ")).join("\n");
|
||||
expect(output).toContain("Empty Cloud");
|
||||
expect(output).toContain("Cloud with no agents");
|
||||
});
|
||||
|
||||
it("should display notes for agent-less cloud", async () => {
|
||||
global.fetch = mock(async () => new Response(JSON.stringify(manifestWithNotes)));
|
||||
await loadManifest(true);
|
||||
|
||||
await cmdCloudInfo("emptycloud");
|
||||
const output = consoleMocks.log.mock.calls.map((c: unknown[]) => c.join(" ")).join("\n");
|
||||
expect(output).toContain("special setup instructions");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ describe("credentialHints", () => {
|
|||
});
|
||||
|
||||
describe("when all required env vars are set", () => {
|
||||
it("reports credentials appear set and suggests they may be invalid", () => {
|
||||
it("reports credentials appear set, suggests they may be invalid, and lists env var names", () => {
|
||||
setEnv("HCLOUD_TOKEN", "test-token");
|
||||
setEnv("OPENROUTER_API_KEY", "sk-or-v1-test");
|
||||
const hints = credentialHints("hetzner", "HCLOUD_TOKEN");
|
||||
|
|
@ -86,13 +86,6 @@ describe("credentialHints", () => {
|
|||
expect(joined).toContain("Credentials appear to be set");
|
||||
expect(joined).toContain("invalid or expired");
|
||||
expect(joined).toContain("spawn hetzner");
|
||||
});
|
||||
|
||||
it("lists the env var names when all are set", () => {
|
||||
setEnv("HCLOUD_TOKEN", "test-token");
|
||||
setEnv("OPENROUTER_API_KEY", "sk-or-v1-test");
|
||||
const hints = credentialHints("hetzner", "HCLOUD_TOKEN");
|
||||
const joined = hints.join("\n");
|
||||
expect(joined).toContain("HCLOUD_TOKEN");
|
||||
expect(joined).toContain("OPENROUTER_API_KEY");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue