Further reduced code repetition for typeof x === 'something'

This commit is contained in:
Giora Guttsait 2017-09-27 10:11:23 +03:00
parent 4850b97143
commit 127c800638
2 changed files with 58 additions and 52 deletions

16
test.js
View file

@ -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])
});
});