-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(numbers): add toBeGreaterThanOrEqualTo
- Loading branch information
1 parent
c5bc875
commit ac5da2a
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
var toBeNumber = require('./toBeNumber'); | ||
|
||
module.exports = toBeGreaterThanOrEqualTo; | ||
|
||
function toBeGreaterThanOrEqualTo(otherNumber, actual) { | ||
return toBeNumber(actual) && actual >= otherNumber; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
describe('toBeGreaterThanOrEqualTo', function () { | ||
it('asserts value is greater or equal than a given number', function () { | ||
expect(2).toBeGreaterThanOrEqualTo(1); | ||
expect(1).toBeGreaterThanOrEqualTo(-1); | ||
expect(-1).toBeGreaterThanOrEqualTo(-2); | ||
expect(-2).toBeGreaterThanOrEqualTo(-2); | ||
expect(NaN).not.toBeGreaterThanOrEqualTo(0); | ||
expect(1).not.toBeGreaterThanOrEqualTo(2); | ||
expect(-1).not.toBeGreaterThanOrEqualTo(0); | ||
}); | ||
}); |