Passed
Push — master ( 316078...d4e34d )
by Dmytro
02:03 queued 11s
created

tests/unit/utils.test.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 23
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 14
mnd 0
bc 0
fnc 3
dl 0
loc 23
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
1
import { assert } from 'chai';
2
import { dumpCommand, resolveUrl } from 'utils';
3
import factory from '../Test';
4
5
suite('Utils');
6
7
before(async function () {
8
    await factory.cleanup();
9
});
10
11
test('parse telegram commands', async function () {
12
    assert.deepOwnInclude(dumpCommand('/url "my cool template"'), {
13
        command  : 'url',
14
        template : 'my cool template'
15
    });
16
});
17
18
test('resolve url', function () {
19
    assert.equal(
20
        resolveUrl(null, 'http://google.com').href,
21
        'http://google.com/'
22
    );
23
});
24