diff --git a/main/mock/matchers.ts b/main/mock/matchers.ts index 53a3815..9e39b37 100644 --- a/main/mock/matchers.ts +++ b/main/mock/matchers.ts @@ -56,7 +56,10 @@ function mapToJestCustomMatcher(matcher: ICustomMatcher): jest.CustomMatcher { return (context: IFunctionVerifier, received: any, ...actual: any[]) => { const result = matcher.compare(context, received, ...actual); - return { pass: result.pass, message: () => result.message || 'failed' }; + return { + pass: result.pass, + message: typeof result.message === 'function' ? result.message : () => result.message || 'failed', + }; }; }