test: consolidate failure guards and trim unused fixture APIs

This commit is contained in:
morluto
2026-10-09 03:13:43 +08:00
parent 81ae838567
commit ffd9611308
38 changed files with 90 additions and 203 deletions
@@ -58,7 +58,6 @@ describe("additional client configuration dialects", () => {
const client = getClients(home).find(
(candidate) => candidate.name === name,
);
expect(client).toBeDefined();
if (client === undefined) throw new Error(`missing ${name} client`);
await mkdir(client.markerPath ?? home, { recursive: true });
@@ -126,7 +125,6 @@ describe("additional client configuration dialects", () => {
it("preserves OpenCode JSONC comments and sibling registrations during update and removal", async () => {
const home = await createTestTempDirectory("rea-opencode-jsonc-");
const client = getClients(home).find(({ name }) => name === "opencode");
expect(client).toBeDefined();
if (client === undefined) throw new Error("missing OpenCode client");
await mkdir(client.markerPath ?? home, { recursive: true });
const original = `{
@@ -177,7 +175,6 @@ describe("additional client configuration dialects", () => {
it("rejects malformed OpenCode JSONC without creating a backup or changing bytes", async () => {
const home = await createTestTempDirectory("rea-opencode-invalid-");
const client = getClients(home).find(({ name }) => name === "opencode");
expect(client).toBeDefined();
if (client === undefined) throw new Error("missing OpenCode client");
await mkdir(client.markerPath ?? home, { recursive: true });
const invalid = '{ "mcp": { /* broken */ "rea": [ }';