From e53f6a1bf085785a15859720dae0aefe84469e54 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Mon, 14 Sep 2026 09:12:08 -0400 Subject: [PATCH] test: await each strict refusal before starting the next (#2374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The negative control started all three refused calls up front and awaited them in turn, so the later rejections sat unhandled while the first was awaited. Vitest reports that as an unhandled error and fails the run even with every assertion passing — which is how local:gate went red on a green suite. Start each call only when it is awaited. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q3RsrgCxVoFPokLB4vAkxi Signed-off-by: cliffhall --- .../integration/mcp/inspectorClient-skills.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clients/web/src/test/integration/mcp/inspectorClient-skills.test.ts b/clients/web/src/test/integration/mcp/inspectorClient-skills.test.ts index 48cea122..fb7dc821 100644 --- a/clients/web/src/test/integration/mcp/inspectorClient-skills.test.ts +++ b/clients/web/src/test/integration/mcp/inspectorClient-skills.test.ts @@ -158,13 +158,16 @@ describe("Skills extension over a real transport (#2234)", () => { }, } : { code: -32601 }; + // Thunks, not promises: starting all three up front leaves the later + // rejections unhandled while the first is awaited, which fails the + // run even though every assertion passes. const refusals = [ - connected.listSkills(), - connected.getSkill("skill://data-analysis/SKILL.md"), - connected.readResourceDirectory("skill://data-analysis"), + () => connected.listSkills(), + () => connected.getSkill("skill://data-analysis/SKILL.md"), + () => connected.readResourceDirectory("skill://data-analysis"), ]; for (const refusal of refusals) { - await expect(refusal).rejects.toMatchObject({ + await expect(refusal()).rejects.toMatchObject({ ...expected, message: expect.stringMatching( /requires the client to declare io\.modelcontextprotocol\/skills/,