Skip to content

Commit

Permalink
Built distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
sgravrock committed Sep 10, 2019
1 parent ba4a8d1 commit 96ba66a
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions lib/jasmine-core/jasmine.js
Expand Up @@ -445,7 +445,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
* that will succeed if every key/value pair in the sample passes the deep equality comparison
* with at least one key/value pair in the actual value being compared
* @name jasmine.mapContaining
* @since
* @since 3.5.0
* @function
* @param {Map} sample - The subset of items that _must_ be in the actual.
*/
Expand All @@ -457,8 +457,8 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
* Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}),
* that will succeed if every item in the sample passes the deep equality comparison
* with at least one item in the actual value being compared
* @name jasmine.mapContaining
* @since
* @name jasmine.setContaining
* @since 3.5.0
* @function
* @param {Set} sample - The subset of items that _must_ be in the actual.
*/
Expand Down Expand Up @@ -3939,7 +3939,7 @@ getJasmineRequireObj().toBeRejectedWithError = function(j$) {
function getExpectedFromArgs(arg1, arg2) {
var error, message;

if (typeof arg1 === 'function' && j$.isError_(arg1.prototype)) {
if (isErrorConstructor(arg1)) {
error = arg1;
message = arg2;
} else {
Expand All @@ -3953,6 +3953,10 @@ getJasmineRequireObj().toBeRejectedWithError = function(j$) {
printValue: j$.fnNameFor(error) + (typeof message === 'undefined' ? '' : ': ' + j$.pp(message))
};
}

function isErrorConstructor(value) {
return typeof value === 'function' && (value === Error || j$.isError_(value.prototype));
}
};

getJasmineRequireObj().toBeResolved = function(j$) {
Expand Down Expand Up @@ -4011,24 +4015,24 @@ getJasmineRequireObj().toBeResolvedTo = function(j$) {

return actualPromise.then(
function(actualValue) {
if (util.equals(actualValue, expectedValue, customEqualityTesters)) {
return {
pass: true,
message: prefix(true) + '.'
};
} else {
if (util.equals(actualValue, expectedValue, customEqualityTesters)) {
return {
pass: true,
message: prefix(true) + '.'
};
} else {
return {
pass: false,
message: prefix(false) + ' but it was resolved to ' + j$.pp(actualValue) + '.'
};
}
},
function() {
return {
pass: false,
message: prefix(false) + ' but it was resolved to ' + j$.pp(actualValue) + '.'
message: prefix(false) + ' but it was rejected.'
};
}
},
function() {
return {
pass: false,
message: prefix(false) + ' but it was rejected.'
};
}
);
}
};
Expand Down

0 comments on commit 96ba66a

Please sign in to comment.