@fgv/ts-utils-jest
Version:
Custom matchers for ts-utils result class
12 lines • 430 B
JavaScript
import { equals } from '@jest/expect-utils';
export const matcherName = 'toHaveBeenCalledWithArgumentsMatching';
export function predicate(received, expected) {
for (let i = 0; i < received.mock.calls.length; i++) {
const args = received.mock.calls[i];
if (equals(args, expected)) {
return { index: i, arguments: args };
}
}
return undefined;
}
//# sourceMappingURL=predicate.js.map