import { type DocumentLocation } from '../../model'; import type { LogSeverity } from '../parse-log'; type MessageProblemSpec = { severity: LogSeverity; message: string | RegExp; data?: any; }; type CodeProblemSpec = { severity: LogSeverity; code: string; data?: any; }; type ProblemSpec = CodeProblemSpec | MessageProblemSpec; declare global { namespace jest { interface Matchers { /** * expect(X).toParse() * * Passes if the source parses to an AST without errors. * * X can be a MarkedSource, a string, or a model. */ toParse(): R; /** * expect(X).toTranslate() * * Passes if the source compiles to code which could be used to * generate SQL. * * X can be a MarkedSource, a string, or a model. */ toTranslate(): R; toReturnType(tp: string): R; toLog(...expectedErrors: ProblemSpec[]): R; toLogAtLeast(...expectedErrors: ProblemSpec[]): R; isLocationIn(at: DocumentLocation, txt: string): R; /** * expect(X).compilesTo('expression-string') * * X should be a string or an expr`string` or a BetaExpression * * The string is compiled, and the compiled string is then "translated" into an expression, * which can be used to check that the compiler did the right thing. * * Warnings are ignored, so need to be checked seperately */ compilesTo(exprString: string): R; toBeExpr(exprString: string): R; hasFieldUsage(paths: string[][]): R; } } } export {};