diff --git a/src/utils/isJestAssertionError.ts b/src/utils/isJestAssertionError.ts index ac7957e..8affd55 100644 --- a/src/utils/isJestAssertionError.ts +++ b/src/utils/isJestAssertionError.ts @@ -1,7 +1,9 @@ import type { JestAssertionError } from 'expect'; +import { isError } from './isError'; + export function isJestAssertionError( error: unknown, ): error is JestAssertionError { - return error ? 'matcherResult' in (error as JestAssertionError) : false; + return isError(error) && 'matcherResult' in (error as JestAssertionError); }