@contract-case/case-core
Version:
Core functionality for the ContractCase contract testing suite
20 lines • 1.11 kB
TypeScript
import { CoreHttpStatusCodeMatcher, CoreUrlEncodedStringMatcher } from '@contract-case/case-core-plugin-http-dsl';
import { AnyCaseMatcherOrData } from '@contract-case/case-plugin-dsl-types';
/**
* Matches http status codes. Matches may be provided as a string, eg '4XX' or '401', or a number.
* If an array is provided, any status codes in the array will be matched.
*
* @param match - the status code to match
* @param example - optionally, an example to use during the test. If you do not provide one, case uses a code that passes the matcher.
* @returns
*/
export declare const httpStatus: (match: number | string | Array<number | string>, example?: number) => CoreHttpStatusCodeMatcher;
/**
* Convenience matcher to treat the string as a uri encoded string. Useful in `path` segments.
*
* During matching, the actual value is decoded with `decodeUriComponent()` and passed to the child matcher.
*
* @param child - Any string matcher or literal string
*/
export declare const uriEncodedString: (child: AnyCaseMatcherOrData) => CoreUrlEncodedStringMatcher;
//# sourceMappingURL=http.d.ts.map