Skip to content

Commit

Permalink
try to fix node assert
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 8, 2018
1 parent f7287aa commit e4db645
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/jest-jasmine2/src/jasmine/Spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* @flow */
/* eslint-disable sort-keys */

import {AssertionError} from 'assert';

import ExpectationFailed from '../expectation_failed';

import expectationResultFactory from '../expectation_result_factory';
Expand Down Expand Up @@ -148,12 +146,12 @@ Spec.prototype.onException = function onException(error) {
return;
}

if (error instanceof ExpectationFailed) {
return;
if (error && error.code === 'ERR_ASSERTION') {
error = assertionErrorMessage(error, {expand: this.expand});
}

if (error instanceof AssertionError) {
error = assertionErrorMessage(error, {expand: this.expand});
if (error instanceof ExpectationFailed) {
return;
}

this.addExpectationResult(
Expand Down

0 comments on commit e4db645

Please sign in to comment.