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

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

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 32
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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