How to let know typescript compiler about jest custom matchers?
问题 I have a react/typescript project, using jest, where I have a custom matcher like: export const MyCustomMatchers = { toBeTheSameAsRemote: function(_util: any, _customEqualityTesters: any) { return { compare: function(actual: Brand, expected: RemoteBrand) { const pass: boolean = attributesMatch(actual, expected); const message: string = pass ? 'Local matches Remote' : 'Local does not match Remote'; return { pass, message: () => message }; } }; } }; which I reference in my tests by doing inside