@contract-case/case-core
Version:
Core functionality for the ContractCase contract testing suite
44 lines • 2.18 kB
TypeScript
import { AnyMockDescriptorType } from '@contract-case/case-entities-internal';
import { DataContext } from '@contract-case/case-plugin-base';
import type { CaseConfig, ContractFileFromDisk, ReaderDependencies } from '../../core/types';
import type { MultiTestInvoker } from '../../core/executeExample/types';
import { ContractVerificationTestHandle, TestPrinter } from './types';
import { CaseContractDescription } from '../../entities/types';
export declare class ContractVerifierConnector {
#private;
contracts: ContractFileFromDisk[];
config: CaseConfig;
dependencies: ReaderDependencies;
context: DataContext;
parentVersions: string[];
constructor(userConfig: CaseConfig, printer: TestPrinter, parentVersions: string[], dependencies?: ReaderDependencies);
private filterContractsWithConfiguration;
getAvailableContractDescriptions(): CaseContractDescription[];
/**
* This is the main entry point to verifying contract(s). It doesn't run the
* verification immediately,
* it returns a list of tests which can be called later with
* {@link ContractVerifierConnector#runPreparedTest}.
*
* @param invoker - The MultiTestInvoker for this run
* @param configOverride - any overridden config from when this runner was created
* @param invokeableFns - any invokeable functions that should be registered
* @returns
*/
prepareVerificationTests<T extends AnyMockDescriptorType>(invoker: MultiTestInvoker<T>, configOverride?: {}, invokeableFns?: Record<string, (...args: unknown[]) => Promise<unknown>>): ContractVerificationTestHandle[];
/**
* Runs a prepared test returned by {@link prepareVerificationTests}.
*
* @param test - the test to run
* @returns a successful promise if the test ran. This doesn't necessarily
* mean that the test passed.
*/
runPreparedTest(test: ContractVerificationTestHandle): Promise<void>;
/**
* Closes a verification
*
* @returns a successful promise if the verification closed successfully
*/
closePreparedVerification(): Promise<void>;
}
//# sourceMappingURL=ContractVerifierConnector.d.ts.map