Merge branch 'tdurtschi-master'

- Merges #1616 from @tdurtshi
- Fixes #1614
This commit is contained in:
Gregg Van Hove
2018-10-22 10:57:50 -07:00
3 changed files with 67 additions and 12 deletions

View File

@@ -3765,7 +3765,7 @@ getJasmineRequireObj().ObjectPath = function(j$) {
return ObjectPath;
};
getJasmineRequireObj().toBe = function() {
getJasmineRequireObj().toBe = function(j$) {
/**
* {@link expect} the actual value to be `===` to the expected value.
* @function
@@ -3774,12 +3774,20 @@ getJasmineRequireObj().toBe = function() {
* @example
* expect(thing).toBe(realThing);
*/
function toBe() {
function toBe(util) {
var tip = ' Tip: To check for deep equality, use .toEqual() instead of .toBe().';
return {
compare: function(actual, expected) {
return {
pass: actual === expected
var result = {
pass: actual === expected,
};
if (typeof expected === 'object') {
result.message = util.buildFailureMessage('toBe', result.pass, actual, expected) + tip;
}
return result;
}
};
}