Skip to content

Commit

Permalink
fix: unhandled error for timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Feb 17, 2024
1 parent d9795ec commit 128cca2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/isJestAssertionError.ts
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 128cca2

Please sign in to comment.