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 ( 043e72...5d2753 )
by Benjamin
06:48 queued 02:54
created

test/util/throttle.test.js   A

Complexity

Total Complexity 7
Complexity/F 1.17

Size

Lines of Code 49
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 7
c 1
b 0
f 0
nc 1
mnd 1
bc 7
fnc 6
dl 0
loc 49
rs 10
bpm 1.1666
cpm 1.1666
noi 3
1
/* eslint-enable describe it sinon */
2
3
import expect from 'expect';
4
import {
5
    throttle, debounce
6
} from './../../src/util/throttle';
7
8
describe('throttle utility function', () => {
9
10
    it('Should call a function', () => {
11
        const spy = sinon.spy();
12
        const func = throttle(spy, null);
13
14
        func();
15
16
        expect(spy.called)
17
            .toEqual(true);
18
    });
19
20
    it('Should call a function only once', () => {
21
        const spy = sinon.spy();
22
        const func = throttle(spy, null);
23
24
        for (let i = 0; i < 10; i++) {
25
            func();
26
        }
27
28
        expect(spy.callCount)
29
            .toEqual(1);
30
    });
31
});
32
33
describe('debounce utility function', () => {
34
35
    it('Should call a function after timeout', (done) => {
36
        const spy = sinon.spy();
37
        const func = debounce(spy, 100);
38
39
        func();
40
41
        expect(spy.called)
42
            .toEqual(false);
43
44
        setTimeout(() => {
45
            expect(spy.called)
46
                .toEqual(true);
47
            done();
48
        }, 101);
49
    });
50
51
});
52