Further reduced code repetition for typeof x === 'something'
This commit is contained in:
parent
4850b97143
commit
127c800638
2 changed files with 58 additions and 52 deletions
16
test.js
16
test.js
|
|
@ -251,7 +251,9 @@ test('is.primitive', t => {
|
|||
Symbol('🦄')
|
||||
];
|
||||
|
||||
primitives.forEach(el => t.true(m.primitive(el)));
|
||||
for (const el of primitives) {
|
||||
t.true(m.primitive(el));
|
||||
}
|
||||
});
|
||||
|
||||
test('is.integer', t => {
|
||||
|
|
@ -326,11 +328,11 @@ test('is.inRange', t => {
|
|||
t.false(m.inRange(x, 2));
|
||||
t.false(m.inRange(-3, -2));
|
||||
|
||||
t.throws(() =>
|
||||
t.true(m.inRange(0))
|
||||
);
|
||||
t.throws(() => {
|
||||
m.inRange(0)
|
||||
});
|
||||
|
||||
t.throws(() =>
|
||||
t.true(m.inRange(0, [5]))
|
||||
);
|
||||
t.throws(() => {
|
||||
m.inRange(0, [5])
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue