tests/reporters/lite-reporter.test.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 34
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 22
mnd 0
bc 0
fnc 2
dl 0
loc 34
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import Test, { fixtures } from '../Test';
2
import chronicle, { reporters }  from '../entry';
3
import { compareTexts } from '../utils';
4
5
const Reporter = reporters.lite;
6
7
const factory = new Test(chronicle);
8
9
suite('lite reporter');
10
11
before(async function () {
12
    await factory.cleanup();
13
    await factory.setActions();
14
    await factory.setTmpFolder();
15
    chronicle.headers = {
16
        response : {
17
            include : []
18
        }
19
    };
20
});
21
22
23
test('Positive: lite template with one action', async function () {
24
    const action = factory.actions[0].data;
25
    const groups = { [action.context.group]: { [action.context.title]: [ action.id ] } };
26
    const reporter = new Reporter();
27
    const map = new Map([ [ action.id, action ] ]);
28
29
    await reporter._init();
30
    compareTexts(
31
        reporter._generate(groups, map),
32
        fixtures.reports.lite.createUser
33
    );
34
});
35
36