Comparing version 21.3.0-beta.12 to 21.3.0-beta.13
@@ -56,6 +56,15 @@ 'use strict'; | ||
const getPromiseMatcher = name => { | ||
const createToThrowErrorMatchingSnapshotMatcher = function (matcher) { | ||
return function (received, testName) { | ||
return matcher.apply(this, [received, testName, true]); | ||
}; | ||
}; | ||
const getPromiseMatcher = (name, matcher) => { | ||
if (name === 'toThrow' || name === 'toThrowError') { | ||
return (0, _to_throw_matchers.createMatcher)('.' + name, true); | ||
} else if (name === 'toThrowErrorMatchingSnapshot') { | ||
return createToThrowErrorMatchingSnapshotMatcher(matcher); | ||
} | ||
return null; | ||
@@ -78,3 +87,3 @@ }; | ||
const matcher = allMatchers[name]; | ||
const promiseMatcher = getPromiseMatcher(name) || matcher; | ||
const promiseMatcher = getPromiseMatcher(name, matcher) || matcher; | ||
expectation[name] = makeThrowingMatcher(matcher, false, actual); | ||
@@ -81,0 +90,0 @@ expectation.not[name] = makeThrowingMatcher(matcher, true, actual); |
@@ -556,5 +556,5 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true }); | ||
traversedPath ? | ||
`Received:\n ${(0, _jestMatcherUtils.RECEIVED_COLOR)('object')}.${ | ||
traversedPath | ||
}: ${(0, _jestMatcherUtils.printReceived)(lastTraversedObject)}` : | ||
`Received:\n ${(0, _jestMatcherUtils.RECEIVED_COLOR)( | ||
'object') | ||
}.${traversedPath}: ${(0, _jestMatcherUtils.printReceived)(lastTraversedObject)}` : | ||
'')); | ||
@@ -561,0 +561,0 @@ |
{ | ||
"name": "expect", | ||
"version": "21.3.0-beta.12", | ||
"version": "21.3.0-beta.13", | ||
"repository": { | ||
@@ -13,8 +13,8 @@ "type": "git", | ||
"ansi-styles": "^3.2.0", | ||
"jest-diff": "21.3.0-beta.12", | ||
"jest-get-type": "21.3.0-beta.12", | ||
"jest-matcher-utils": "21.3.0-beta.12", | ||
"jest-message-util": "21.3.0-beta.12", | ||
"jest-diff": "21.3.0-beta.13", | ||
"jest-get-type": "21.3.0-beta.13", | ||
"jest-matcher-utils": "21.3.0-beta.13", | ||
"jest-message-util": "21.3.0-beta.13", | ||
"jest-regex-util": "^21.2.0" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
508992
13412
+ Addedjest-diff@21.3.0-beta.13(transitive)
+ Addedjest-get-type@21.3.0-beta.13(transitive)
+ Addedjest-matcher-utils@21.3.0-beta.13(transitive)
+ Addedjest-message-util@21.3.0-beta.13(transitive)
+ Addedpretty-format@21.3.0-beta.13(transitive)
- Removedjest-diff@21.3.0-beta.12(transitive)
- Removedjest-get-type@21.3.0-beta.12(transitive)
- Removedjest-matcher-utils@21.3.0-beta.12(transitive)
- Removedjest-message-util@21.3.0-beta.12(transitive)
- Removedpretty-format@21.3.0-beta.12(transitive)
Updatedjest-diff@21.3.0-beta.13
Updatedjest-get-type@21.3.0-beta.13