(result: SpecResult)
| 30 | // test execution and add them to the test result, potentially failing |
| 31 | // a passing test. |
| 32 | const addSuppressedErrors = (result: SpecResult) => { |
| 33 | const {suppressedErrors} = jestExpect.getState(); |
| 34 | jestExpect.setState({suppressedErrors: []}); |
| 35 | if (suppressedErrors.length > 0) { |
| 36 | result.status = 'failed'; |
| 37 | |
| 38 | result.failedExpectations = suppressedErrors.map(error => ({ |
| 39 | actual: '', |
| 40 | // passing error for custom test reporters |
| 41 | error, |
| 42 | expected: '', |
| 43 | matcherName: '', |
| 44 | message: error.message, |
| 45 | passed: false, |
| 46 | stack: error.stack, |
| 47 | })); |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | const addAssertionErrors = (result: SpecResult) => { |
| 52 | const assertionErrors = jestExpect.extractExpectedAssertionsErrors(); |
no test coverage detected