Merge branch 'issue-1294' of https://github.com/toubou91/jasmine into toubou91-issue-1294
- Merges #1300 from @toubou91 - Fixes #1294
This commit is contained in:
@@ -97,18 +97,20 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
||||
'toBeFalsy',
|
||||
'toBeGreaterThan',
|
||||
'toBeGreaterThanOrEqual',
|
||||
'toBeLessThanOrEqual',
|
||||
'toBeLessThan',
|
||||
'toBeLessThanOrEqual',
|
||||
'toBeNaN',
|
||||
'toBeNegativeInfinity',
|
||||
'toBeNull',
|
||||
'toBePositiveInfinity',
|
||||
'toBeTruthy',
|
||||
'toBeUndefined',
|
||||
'toContain',
|
||||
'toEqual',
|
||||
'toHaveBeenCalled',
|
||||
'toHaveBeenCalledBefore',
|
||||
'toHaveBeenCalledWith',
|
||||
'toHaveBeenCalledTimes',
|
||||
'toHaveBeenCalledWith',
|
||||
'toMatch',
|
||||
'toThrow',
|
||||
'toThrowError'
|
||||
@@ -2894,6 +2896,35 @@ getJasmineRequireObj().toBeNaN = function(j$) {
|
||||
return toBeNaN;
|
||||
};
|
||||
|
||||
getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
|
||||
/**
|
||||
* {@link expect} the actual value to be `-Infinity` (-infinity).
|
||||
* @function
|
||||
* @name matchers#toBeNegativeInfinity
|
||||
* @example
|
||||
* expect(thing).toBeNegativeInfinity();
|
||||
*/
|
||||
function toBeNegativeInfinity() {
|
||||
return {
|
||||
compare: function(actual) {
|
||||
var result = {
|
||||
pass: (actual === Number.NEGATIVE_INFINITY)
|
||||
};
|
||||
|
||||
if (result.pass) {
|
||||
result.message = 'Expected actual to be -Infinity.';
|
||||
} else {
|
||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' not to be -Infinity.'; };
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return toBeNegativeInfinity;
|
||||
};
|
||||
|
||||
getJasmineRequireObj().toBeNull = function() {
|
||||
/**
|
||||
* {@link expect} the actual value to be `null`.
|
||||
@@ -2915,6 +2946,35 @@ getJasmineRequireObj().toBeNull = function() {
|
||||
return toBeNull;
|
||||
};
|
||||
|
||||
getJasmineRequireObj().toBePositiveInfinity = function(j$) {
|
||||
/**
|
||||
* {@link expect} the actual value to be `Infinity` (infinity).
|
||||
* @function
|
||||
* @name matchers#toBePositiveInfinity
|
||||
* @example
|
||||
* expect(thing).toBePositiveInfinity();
|
||||
*/
|
||||
function toBePositiveInfinity() {
|
||||
return {
|
||||
compare: function(actual) {
|
||||
var result = {
|
||||
pass: (actual === Number.POSITIVE_INFINITY)
|
||||
};
|
||||
|
||||
if (result.pass) {
|
||||
result.message = 'Expected actual to be Infinity.';
|
||||
} else {
|
||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' not to be Infinity.'; };
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return toBePositiveInfinity;
|
||||
};
|
||||
|
||||
getJasmineRequireObj().toBeTruthy = function() {
|
||||
/**
|
||||
* {@link expect} the actual value to be truthy.
|
||||
|
||||
Reference in New Issue
Block a user