Skip to content

Commit 5a5fd5b

Browse files
committed
test(formula,mcp): type the new pins for the test-layer typecheck
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzf4UmgvS2cusNbWnvy
1 parent a708eff commit 5a5fd5b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/formula/src/validate.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ describe('validateExpression (ADR-0032)', () => {
818818
] as const) {
819819
const r = validateExpression('predicate', source, flat);
820820
expect(r.warnings, source).toHaveLength(0);
821-
expect(r.errors.map((e) => [e.code, e.params.reference]), source).toEqual([['type-mismatch-run-fails', reference]]);
821+
expect(r.errors.map((e) => [e.code, (e.params as { reference?: string }).reference]), source).toEqual([['type-mismatch-run-fails', reference]]);
822822
expect(r.errors[0].message, source).toContain(`\`${reference}\``);
823823
}
824824
// Controls: a well-typed record read, a number field, and the

‎packages/mcp/src/mcp-validate-expression.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ describe('validate_expression MCP tool (#1928)', () => {
199199
{ triggerKind: 'record_change' },
200200
]) {
201201
const { json } = await call(runtime, toolsCall(1, 'validate_expression', { objectName: 'crm_opportunity', expression: 'record.title > 5', ...args }), bridge);
202-
expect(json.result.isError, JSON.stringify(args)).toBe(true);
203-
expect(json.result.content[0].text, JSON.stringify(args)).toMatch(/applies only with site/);
202+
const { result } = json as { result: { isError?: boolean; content: { text: string }[] } };
203+
expect(result.isError, JSON.stringify(args)).toBe(true);
204+
expect(result.content[0]!.text, JSON.stringify(args)).toMatch(/applies only with site/);
204205
}
205206
});
206207

0 commit comments

Comments
 (0)