Skip to content

Commit e53f6a1

Browse files
cliffhallclaude
andcommitted
test: await each strict refusal before starting the next (#2374)
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) <[email protected]> Claude-Session: https://claude.ai/code/session_01Q3RsrgCxVoFPokLB4vAkxi Signed-off-by: cliffhall <[email protected]>
1 parent 2243849 commit e53f6a1

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎clients/web/src/test/integration/mcp/inspectorClient-skills.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,16 @@ describe("Skills extension over a real transport (#2234)", () => {
158158
},
159159
}
160160
: { code: -32601 };
161+
// Thunks, not promises: starting all three up front leaves the later
162+
// rejections unhandled while the first is awaited, which fails the
163+
// run even though every assertion passes.
161164
const refusals = [
162-
connected.listSkills(),
163-
connected.getSkill("skill://data-analysis/SKILL.md"),
164-
connected.readResourceDirectory("skill://data-analysis"),
165+
() => connected.listSkills(),
166+
() => connected.getSkill("skill://data-analysis/SKILL.md"),
167+
() => connected.readResourceDirectory("skill://data-analysis"),
165168
];
166169
for (const refusal of refusals) {
167-
await expect(refusal).rejects.toMatchObject({
170+
await expect(refusal()).rejects.toMatchObject({
168171
...expected,
169172
message: expect.stringMatching(
170173
/requires the client to declare io\.modelcontextprotocol\/skills/,

0 commit comments

Comments
 (0)