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
Push — master ( e60a44...192942 )
by Cedric
02:30
created

test/model/store.spec.js   A

Complexity

Total Complexity 15
Complexity/F 1

Size

Lines of Code 87
Function Count 15

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 15
c 2
b 0
f 0
nc 1
mnd 0
bc 15
fnc 15
dl 0
loc 87
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A store.spec.js ➔ ??? 0 9 1
1
import {expect} from 'chai';
2
import store from '../../src/model/store';
3
4
describe('store reset', () => {
5
    it('should empty the store', () => {
6
        store._store = {
7
            'foo': 'bar'
8
        };
9
        store.reset();
10
        expect(store._store).not.to.have.property('foo');
11
    });
12
});
13
14
describe('store set', () => {
15
    beforeEach(() => {
16
        store.reset();
17
    });
18
19
    it('should be able to set a key/value', () => {
20
        store.set('foo', 'bar');
21
        expect(store._store).to.have.property('foo', 'bar');
22
    });
23
24
    it('should be able to set a multi level key', () => {
25
        store.set('foo.bar', 42);
26
        expect(store._store).to.have.property('foo');
27
        expect(store._store.foo).to.have.property('bar', 42);
28
    });
29
30
    it('should be able to set a multi level key', () => {
31
        store.set('foo.bar.deep', 42);
32
        expect(store._store).to.have.property('foo');
33
        expect(store._store.foo).to.have.property('bar');
34
        expect(store._store.foo.bar).to.have.property('deep', 42);
35
    });
36
37
    it('should be able to set multiple multi level key', () => {
38
        store.set('foo.bar.deep', 42);
39
        store.set('foo.baz.deep', 43);
40
        expect(store._store).to.have.property('foo');
41
        expect(store._store.foo).to.have.property('bar');
42
        expect(store._store.foo).to.have.property('baz');
43
        expect(store._store.foo.bar).to.have.property('deep', 42);
44
        expect(store._store.foo.baz).to.have.property('deep', 43);
45
    });
46
});
47
48
49
describe('store get', () => {
50
51
    beforeEach(() => {
52
        store.reset();
53
        store._store = {
54
            'foo': {
55
                'bar': {
56
                    'baz': 42
57
                }
58
            },
59
            'foobar': 'raboof',
60
            'foobaz': 'zaboof'
61
        };
62
    });
63
64
65
    it('should be able to recover a value from the store', () => {
66
        expect(store.get('foobar')).to.equal('raboof');
67
    });
68
69
    it('should be able to read a multi level key from the store', () => {
70
        let value = store.get('foo.bar');
71
        expect(value).to.have.property('baz', 42);
72
    });
73
74
    it('should be able to read a multi level key from the store', () => {
75
        expect(store.get('foo.bar.baz')).to.equal(42);
76
    });
77
78
    it('should return the whole store if no key is given', () => {
79
        let value = store.get();
80
        expect(value).to.have.property('foobar', 'raboof');
81
        expect(value).to.have.property('foobaz', 'zaboof');
82
    });
83
84
    it('should return the default value if the key is undefined', () => {
85
        expect(store.get('unknown', 42)).to.equal(42);
86
    });
87
});
88