tests/reporters/api-blueprint.test.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 28
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 19
mnd 0
bc 0
fnc 2
dl 0
loc 28
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['api-blueprint'];
6
7
const factory = new Test(chronicle);
8
9
suite('api-blueprint reporter');
10
11
before(async function () {
12
    await factory.cleanup();
13
    await factory.setActions();
14
    await factory.setTmpFolder();
15
});
16
17
test('Positive: api-blueprint template with one action', async function () {
18
    const action = factory.actions[0].data;
19
    const groups = { [action.context.group]: { [action.context.title]: [ action.id ] } };
20
    const reporter = new Reporter();
21
    const map = new Map([ [ action.id, action ] ]);
22
23
    await reporter._init();
24
    compareTexts(
25
        reporter._generate(groups, map),
26
        fixtures.reports.apiBlueprint.createUser
27
    );
28
});
29