tests/generators/date.test.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 20
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 13
mnd 0
bc 0
fnc 2
dl 0
loc 20
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { assert } from 'chai';
2
import entry from '../entry';
3
4
suite('Generators: date');
5
6
test('no params', function () {
7
    const date = entry.date();
8
9
    assert.isAbove(date, new Date(Date.now() - 366 * 24 * 60 * 60 * 1000));
10
    assert.isBelow(date, new Date());
11
});
12
13
test('next week', function () {
14
    const min = new Date();
15
    const max = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000);
16
    const date = entry.date(min, max);
17
18
    assert.isAbove(date, min);
19
    assert.isBelow(date, max);
20
});
21