Skip to content

Commit 7a7b603

Browse files
committed
test(mcp): type the relation-condition pin's engine double
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfJfBUC3cQ6hhgm9MQK76T
1 parent ebdb49c commit 7a7b603

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎packages/mcp/src/stdio-data-bridge.relation-condition-target-exposure.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ const REFUSED = [
4848
] as const;
4949

5050
function makeBridge() {
51-
const engine = { find: vi.fn(async () => [{ id: 's1' }]), aggregate: vi.fn(async () => [{ n: 1 }]) };
51+
const engine = {
52+
find: vi.fn(async (_object: string, _query?: { where?: unknown }) => [{ id: 's1' }]),
53+
aggregate: vi.fn(async (_object: string, _query?: { where?: unknown }) => [{ n: 1 }]),
54+
};
5255
const metadataService = { getObject: vi.fn(async (name: string) => DEFS[name]) };
5356
const bridge = createStdioDataBridge({
5457
engine: engine as unknown as IDataEngine,
@@ -98,9 +101,7 @@ describe('[#22777] the stdio bridge refuses a condition on a target the decision
98101
]) {
99102
const { bridge, engine } = makeBridge();
100103
await run(bridge, where);
101-
const call = (verb === 'query' ? engine.find.mock.calls[0]?.[1] : engine.aggregate.mock.calls[0]?.[1]) as
102-
| { where?: unknown }
103-
| undefined;
104+
const call = (verb === 'query' ? engine.find : engine.aggregate).mock.calls[0]?.[1];
104105
expect(call?.where, JSON.stringify(where)).toBe(where);
105106
}
106107
});

0 commit comments

Comments
 (0)