Skip to content

Commit 1b40d3f

Browse files
committed
Expose JestAssertionError to custom matchers
1 parent 774d457 commit 1b40d3f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/expect/src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,8 @@ expect.getState = getState;
296296
expect.setState = setState;
297297
expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors;
298298

299+
// Expose JestAssertionError for custom matchers
300+
// This enables them to preserve the stack for specific errors
301+
expect.JestAssertionError = JestAssertionError;
302+
299303
module.exports = (expect: Expect);

0 commit comments

Comments
 (0)