Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 23 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { RuleTester } from '../utils'; |
||
2 | |||
3 | const tester = new RuleTester('string'); |
||
4 | |||
5 | suite('Rules: string'); |
||
6 | |||
7 | test('Positive: string', function () { |
||
8 | tester.positive('5', '5'); |
||
9 | tester.positive('[email protected]', '[email protected]'); |
||
10 | }); |
||
11 | |||
12 | test('Positive: empty value', function () { |
||
13 | tester.positive(null, null); |
||
14 | tester.positive(undefined, undefined); |
||
15 | }); |
||
16 | |||
17 | test('Negative: bad formats', function () { |
||
18 | tester.negative(4, 'NOT_STRING', 'The value is not a string'); |
||
19 | tester.negative({ object: 1 }, 'NOT_STRING', 'The value is not a string'); |
||
20 | tester.negative(false, 'NOT_STRING', 'The value is not a string'); |
||
21 | tester.negative(true, 'NOT_STRING', 'The value is not a string'); |
||
22 | tester.negative([ 'fkdsfdsfkds' ], 'NOT_STRING', 'The value is not a string'); |
||
23 | }); |
||
24 |