Passed
Push — master ( 9fe3d5...8bdd03 )
by Dmytro
02:03
created

tests/helpers/custom/setProp.test.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 31
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 21
mnd 0
bc 0
fnc 1
dl 0
loc 31
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { FunctionTester } from 'tests/utils';
2
import { setProp } from 'tests/entry';
3
/* eslint-disable prefer-arrow-callback */
4
5
suite('custom: setProp');
6
7
const tester = new FunctionTester(setProp);
8
9
test('Positive: setProp', function () {
10
    tester.test(
11
        {},
12
        'user.firstName',
13
        'Jason',
14
        undefined,
15
        { user: { firstName: 'Jason' } }
16
    );
17
18
    tester.test(
19
        {},
20
        'users.0.email',
21
        '[email protected]',
22
        { users: [ { email: '[email protected]' } ] }
23
    );
24
25
    tester.test(
26
        { user: { id: 1 } },
27
        'user.email',
28
        '[email protected]',
29
        { user: { id: 1, email: '[email protected]' }  }
30
    );
31
});
32