What happened?
Currently, expect is too permissive. Because MatcherChain is generic over EvalInput and contains all possible matchers, TypeScript allows:
await expect("just a string").toBeFaithful();
However, This should always be taking query, context, and response to run the assertion.
Above will crash on run time because as below piece of code checks for query.
// packages/assertions/src/expect/expect.ts:74
if (!input.query) {
throw new EvaliphyError(
EvaliphyErrorCode.INVALID_ASSERTION_INPUT,
"toBeFaithful requires a query..."
);
}
Acceptance Criteria:
Reproduction steps
No response
Evaliphy version
No response
Relevant log output
What happened?
Currently, expect is too permissive. Because
MatcherChainis generic over EvalInput and contains all possible matchers, TypeScript allows:await expect("just a string").toBeFaithful();However, This should always be taking query, context, and response to run the assertion.
Above will crash on run time because as below piece of code checks for query.
// packages/assertions/src/expect/expect.ts:74
Acceptance Criteria:
Reproduction steps
No response
Evaliphy version
No response
Relevant log output