strong-mock
Version:
Type safe mocking library for TypeScript
16 lines (15 loc) • 502 B
TypeScript
import type { TypeMatcher } from './matcher';
/**
* Match any string.
*
* @param matching An optional string or RegExp to match the string against.
* If it's a string, a case-sensitive search will be performed.
*
* @example
* const fn = mock<(x: string, y: string) => number>();
* when(() => fn(It.isString(), It.isString('bar'))).returns(42);
*
* fn('foo', 'baz') // throws
* fn('foo', 'bar') === 42
*/
export declare const isString: (matching?: string | RegExp) => TypeMatcher<string>;