@contract-case/case-core
Version:
Core functionality for the ContractCase contract testing suite
42 lines • 2.19 kB
TypeScript
import { MatchContext, CaseError, ConfigurationError, CaseTriggerError, TriggerError, VerifyTriggerReturnObjectError, VerificationError } from '@contract-case/case-plugin-base';
/**
* This represents a mismatch during a case execution that isn't covered by a
* matcher (usually this is a misconfiguration that is not well described by a
* {@link ../../entities/errors#CaseConfigurationError | CaseConfigurationError})
*
* @param message - The message that describes this error
* @param actual - The actual value that was received
* @param code - A code that can be looked up in the documentation. This should
* be a unique code specific to this kind of error that users
* could look up in the documentation for more information.
* @param context - The match context this occurred in
* @param expected - An optional expected value (might be a description of what was expected)
* @returns CaseError
*/
export declare const failedExpectationError: (message: string, actual: unknown, code: string, context: MatchContext, expected: unknown) => CaseError;
/**
* This represents an error during execution of an example due to user configuration.
*
* @param error - The error thrown
* @param context - the context that the error was in
* @returns ExecutionError
*/
export declare const configurationError: (error: Error, context: MatchContext) => ConfigurationError;
/**
* This represents an error thrown by user code during execution of an example
* (eg, when a user's trigger is called)
* @param error - The error thrown
* @param context - the context that the error was in
* @returns ExecutionError
*/
export declare const triggerError: (error: CaseTriggerError, context: MatchContext) => TriggerError;
/**
* This represents an error thrown during verification using the provided
* verification function
*
* @param error - The VerifyTriggerReturnObjectError from the verification
* @param context - the context that the error was in
* @returns VerificationError
*/
export declare const verificationError: (error: VerifyTriggerReturnObjectError, context: MatchContext) => VerificationError;
//# sourceMappingURL=MatchingError.d.ts.map