test: assert the dropped-member warning by its binding, not its message
Generalizing the sanitizer changed the warning to one message shared by every
reserved member, moving the offending key into the log's bindings — but this
test still matched on the old message text, so it stopped finding the call at
all. Caught by `npm run ci`.
Asserting `{ key, received }` is the more durable check anyway: the message is
now common to all reserved members, while the binding is what identifies which
one was dropped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177mPHAdECD18nLLCTwR5rh
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
167b9b4dab
commit
1eaebdaf63
1 changed files with 5 additions and 3 deletions
|
|
@ -1579,11 +1579,13 @@ describe("InspectorClient", () => {
|
|||
await client.connect();
|
||||
await client.listTools();
|
||||
|
||||
const call = warn.mock.calls.find((c) =>
|
||||
String(c[1]).includes("progressToken"),
|
||||
// The offending key travels in the log's bindings, not in the message —
|
||||
// the message is shared by every reserved member the sanitizer drops.
|
||||
const call = warn.mock.calls.find(
|
||||
(c) => (c[0] as { key?: string })?.key === "progressToken",
|
||||
);
|
||||
expect(call).toBeDefined();
|
||||
expect(call![0]).toEqual({ received: "object" });
|
||||
expect(call![0]).toEqual({ key: "progressToken", received: "object" });
|
||||
// Belt and braces: the secret must not appear anywhere in the record.
|
||||
expect(JSON.stringify(warn.mock.calls)).not.toContain("sk-live");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue