/** * The verify-cordis-config metadata contract: `disabled` is the one entry * metadata field whose `!!js` expression the Loader interpolates; every other * metadata field must stay static, and a disabled expression must parse. */ import { describe, expect, it } from 'vitest' import { metadataExpressionErrors } from './verify-cordis-config.ts' describe('verify-cordis-config metadata expressions', () => { it('accepts a disabled !!js expression', () => { const problems = metadataExpressionErrors( { id: 'tool-bash', name: '@deepseek-ai/dsh-tool-bash', disabled: { __jsExpr: "process.platform === 'win32'" } }, '[0]', ) expect(problems).toEqual([]) }) it('rejects an expression in a static metadata field', () => { const problems = metadataExpressionErrors({ id: { __jsExpr: 'process.platform' }, name: 'pkg' }, '[0]') expect(problems).toContain('[0].id: !!js is not interpolated here') }) })