forked from orbit-oss/is
Fix isInRange silently returning false when range contains NaN
This commit is contained in:
parent
47415dc46a
commit
ac46b5400d
2 changed files with 12 additions and 0 deletions
|
|
@ -1274,6 +1274,14 @@ test('is.inRange', () => {
|
|||
is.inRange(0, [1, 2, 3]);
|
||||
});
|
||||
|
||||
assert.throws(() => {
|
||||
is.inRange(5, [NaN, 10]);
|
||||
}, TypeError);
|
||||
|
||||
assert.throws(() => {
|
||||
is.inRange(5, [0, NaN]);
|
||||
}, TypeError);
|
||||
|
||||
assert.doesNotThrow(() => {
|
||||
isAssert.inRange(x, [0, 5]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue