@contract-case/case-core
Version:
Core functionality for the ContractCase contract testing suite
34 lines • 1.53 kB
TypeScript
import { CoreArrayEachEntryMatches, CoreArrayLengthMatcher, CoreArrayContainsMatcher, CoreShapedArrayMatcher } from '@contract-case/case-entities-internal';
import { AnyCaseMatcherOrData } from '@contract-case/case-plugin-dsl-types';
type ArrayLengthOptions = {
minLength?: number;
maxLength?: number;
};
/**
* Matches an array where each element matches the provided matcher.
*
* @param matcher - The example object, array, primitive or matcher to match against
*/
export declare const arrayEachEntryMatches: (matcher: AnyCaseMatcherOrData, example?: Array<AnyCaseMatcherOrData>) => CoreArrayEachEntryMatches;
/**
* Matches an Array whose length is within a certain range.
*
* @param options - `ArrayLengthOptions { minLength?: number; maxLength?: number }`
*/
export declare const arrayLength: (options: ArrayLengthOptions) => CoreArrayLengthMatcher;
/**
* Matches an Array which contains elements that match the given matchers.
*
* Note that two different matchers may be satisfied by the same item in the array.
*
* @param matchers - any number of matchers, each of which must be found inside the array.
*/
export declare const arrayContains: (...matchers: AnyCaseMatcherOrData[]) => CoreArrayContainsMatcher;
/**
* Matches an Array which starts with the provided array
*
* @param matchers - An array of matchers that describes the start of the array
*/
export declare const arrayStartsWith: (matchers: AnyCaseMatcherOrData[]) => CoreShapedArrayMatcher;
export {};
//# sourceMappingURL=arrays.d.ts.map