File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/jest-jasmine2/src/jasmine Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
31
/* @flow */
32
32
/* eslint-disable sort-keys */
33
33
34
- import { AssertionError } from 'assert' ;
35
-
36
34
import ExpectationFailed from '../expectation_failed' ;
37
35
38
36
import expectationResultFactory from '../expectation_result_factory' ;
@@ -148,12 +146,12 @@ Spec.prototype.onException = function onException(error) {
148
146
return ;
149
147
}
150
148
151
- if ( error instanceof ExpectationFailed ) {
152
- return ;
149
+ if ( error && error . code === 'ERR_ASSERTION' ) {
150
+ error = assertionErrorMessage ( error , { expand : this . expand } ) ;
153
151
}
154
152
155
- if ( error instanceof AssertionError ) {
156
- error = assertionErrorMessage ( error , { expand : this . expand } ) ;
153
+ if ( error instanceof ExpectationFailed ) {
154
+ return ;
157
155
}
158
156
159
157
this . addExpectationResult (
You can’t perform that action at this time.
0 commit comments