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

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

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 28
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 18
mnd 0
bc 0
fnc 5
dl 0
loc 28
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { isPromise } from '../../entry';
2
import { FunctionTester } from '../../utils';
3
4
const tester = new FunctionTester(isPromise);
5
6
suite('CheckTypes: isPromise');
7
8
test('Positive: isPromise with promise input @example', function () {
9
    tester.test(new Promise(() => {}), true);
10
});
11
12
test('Negative: isPromise with no-promise input @example', function () {
13
    tester.test(13, false);
14
    tester.test(true, false);
15
    tester.test(new Set(), false);
16
});
17
18
test('Negative: isPromise with empty input @example', function () {
19
    tester.test(null, false);
20
    tester.test(undefined, false);
21
    tester.test(0, false);
22
    tester.test('', false);
23
    tester.test(false, false);
24
});
25
26
after(async function () {
27
    // console.log('after', this);
28
});
29
30