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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3RsrgCxVoFPokLB4vAkxi Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
2243849711
commit
e53f6a1bf0
1 changed files with 7 additions and 4 deletions
|
|
@ -158,13 +158,16 @@ describe("Skills extension over a real transport (#2234)", () => {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: { code: -32601 };
|
: { 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 = [
|
const refusals = [
|
||||||
connected.listSkills(),
|
() => connected.listSkills(),
|
||||||
connected.getSkill("skill://data-analysis/SKILL.md"),
|
() => connected.getSkill("skill://data-analysis/SKILL.md"),
|
||||||
connected.readResourceDirectory("skill://data-analysis"),
|
() => connected.readResourceDirectory("skill://data-analysis"),
|
||||||
];
|
];
|
||||||
for (const refusal of refusals) {
|
for (const refusal of refusals) {
|
||||||
await expect(refusal).rejects.toMatchObject({
|
await expect(refusal()).rejects.toMatchObject({
|
||||||
...expected,
|
...expected,
|
||||||
message: expect.stringMatching(
|
message: expect.stringMatching(
|
||||||
/requires the client to declare io\.modelcontextprotocol\/skills/,
|
/requires the client to declare io\.modelcontextprotocol\/skills/,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue