GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch master (5d2753)
by Benjamin
17:29 queued 13:40
created

test/util/setTreeValue.test.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 103
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
c 1
b 0
f 0
nc 1
mnd 0
bc 2
fnc 2
dl 0
loc 103
rs 10
bpm 1
cpm 1
noi 0
1
/* eslint-enable describe it sinon */
2
import expect from 'expect';
3
4
import {
5
    setTreeValue
6
} from './../../src/util/setTreeValue';
7
8
describe('the setTreeValue utility', () => {
9
10
    it('Should turn a tree into a flat list with no identifier', () => {
11
12
        const data = {
13
            root: {
14
                id: -1,
15
                children: [
16
                    {
17
                        id: 1,
18
                        parentId: -1,
19
                        children: [
20
                            {
21
                                id: 11,
22
                                parentId: 1
23
                            },
24
                            {
25
                                id: 12,
26
                                parentId: 1,
27
                                children: [
28
                                    {
29
                                        id: 121,
30
                                        parentId: 12,
31
                                        children: [
32
                                            {
33
                                                id: 1211,
34
                                                parentId: 121
35
                                            }
36
                                        ]
37
                                    }
38
                                ]
39
                            }
40
                        ]
41
                    },
42
                    {
43
                        id: 2,
44
                        parentId: -1,
45
                        children: [
46
                            {
47
                                id: 21,
48
                                parentId: 2
49
                            }
50
                        ]
51
                    }
52
                ]
53
            }
54
        };
55
56
        expect(
57
            setTreeValue(data, [-1, 1, 12, 121], { _hideChildren: true })
58
        ).toEqual({
59
            root: {
60
                id: -1,
61
                children: [
62
                    {
63
                        id: 1,
64
                        parentId: -1,
65
                        children: [
66
                            {
67
                                id: 11,
68
                                parentId: 1
69
                            },
70
                            {
71
                                id: 12,
72
                                parentId: 1,
73
                                children: [
74
                                    {
75
                                        id: 121,
76
                                        _hideChildren: true,
77
                                        parentId: 12,
78
                                        children: [
79
                                            {
80
                                                id: 1211,
81
                                                parentId: 121
82
                                            }
83
                                        ]
84
                                    }
85
                                ]
86
                            }
87
                        ]
88
                    },
89
                    {
90
                        id: 2,
91
                        parentId: -1,
92
                        children: [
93
                            {
94
                                id: 21,
95
                                parentId: 2
96
                            }
97
                        ]
98
                    }
99
                ]
100
            }
101
        });
102
    });
103
104
});
105