Total Complexity | 5 |
Complexity/F | 1 |
Lines of Code | 28 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 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 |