Passed
Push — master ( 86ced5...e9c0b0 )
by Dmytro
01:49
created

tests/helpers/checkType/isBoolean.test.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 24
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 16
mnd 0
bc 0
fnc 3
dl 0
loc 24
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
import { isBoolean } from 'tests/entry';
2
import { FunctionTester } from '../../utils';
3
4
const tester = new FunctionTester(isBoolean);
5
6
suite('CheckTypes: isBoolean');
7
8
test('Positive: isBoolean with boolean input @example', function () {
9
    tester.test(true, true);
10
    tester.test(false, true);
11
    tester.test(new Boolean(true), true);
0 ignored issues
show
introduced by
Usage of type wrappers to create boolean variables is discouraged. They always create objects, whose behavior may be counter-intuitive. Consider using a primitive instead.
Loading history...
12
});
13
14
test('Negative: isBoolean with no-boolean input @example', function () {
15
    tester.test('14', false);
16
    tester.test('', false);
17
    tester.test(Number.NaN, false);
18
    tester.test(null, false);
19
    tester.test(undefined, false);
20
});
21
22
after(async function () {
23
    // console.log('after', this);
24
});
25
26