tests/rules/default.test.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 17
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
mnd 0
bc 0
fnc 2
dl 0
loc 17
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
1
import { RuleTester } from '../utils';
2
3
const tester = new RuleTester({ 'default': 100 });
4
5
suite('Rules: default');
6
7
test('Positive: set default value', function () {
8
    tester.positive(null, 100);
9
    tester.positive(undefined, 100);
10
});
11
12
test('Positive: skip if value is already set', function () {
13
    tester.positive(false, false);
14
    tester.positive(Number.NaN, Number.NaN);
15
    tester.positive(0, 0);
16
    tester.positive('', '');
17
});
18