Judge
Named judge object consumed by suite-level judges and explicit assertions.
Example
Section titled “Example”type RefundOutput = { status: "approved" | "denied" };type RefundMetadata = { expected: { status: RefundOutput["status"] } };
const judge: Judge<JudgeContext<string, RefundOutput, RefundMetadata>> = { name: "RefundStatusJudge", assess: ({ output, metadata }) => ({ score: output.status === metadata.expected.status ? 1 : 0, }),};Type Parameters
Section titled “Type Parameters”TOptions
Section titled “TOptions”TOptions extends JudgeContext<any, any, any, any> = JudgeContext
Properties
Section titled “Properties”assess
Section titled “assess”assess:
JudgeAssessFn<TOptions>
Scores one normalized judge context.
judgeHarness?
Section titled “judgeHarness?”
optionaljudgeHarness?:JudgeHarness
Default judge-side harness used when matcher options do not provide one.
name:
string
Stable judge name used in assertion messages and reports.