Skip to content
Permalink
Browse files

Merge d900648 into 385236b

  • Loading branch information...
papandreou committed Jan 1, 2019
2 parents 385236b + d900648 commit 27bfa2ccde31472b119891747f74d75237765841
Showing with 2 additions and 21 deletions.
  1. +2 −21 lib/assertions.js
@@ -4,7 +4,6 @@ const arrayChanges = require('array-changes');
const arrayChangesAsync = require('array-changes-async');
const throwIfNonUnexpectedError = require('./throwIfNonUnexpectedError');
const objectIs = utils.objectIs;
const isRegExp = utils.isRegExp;
const extend = utils.extend;

module.exports = expect => {
@@ -2265,17 +2264,7 @@ module.exports = expect => {
expect.errorMode = 'nested';
return expect(subject, 'to be rejected').tap(err =>
expect.withError(
() => {
if (
err &&
err._isUnexpected &&
(typeof value === 'string' || isRegExp(value))
) {
return expect(err, 'to have message', value);
} else {
return expect(err, 'to [exhaustively] satisfy', value);
}
},
() => expect(err, 'to [exhaustively] satisfy', value),
e => {
e.originalError = err;
throw e;
@@ -2525,15 +2514,7 @@ module.exports = expect => {
(expect, subject, value) =>
expect(subject, 'to call the callback with error').tap(err => {
expect.errorMode = 'nested';
if (
err &&
err._isUnexpected &&
(typeof value === 'string' || isRegExp(value))
) {
return expect(err, 'to have message', value);
} else {
return expect(err, 'to satisfy', value);
}
expect(err, 'to satisfy', value);
})
);
};

0 comments on commit 27bfa2c

Please sign in to comment.
You can’t perform that action at this time.