Passed
Push — master ( 3b3ae1...0bee8f )
by Dmytro
02:00
created

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

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 29
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 29
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
18
test('Positive: api-blueprint template with one action', async function () {
19
    const action = factory.actions[0].data;
20
    const groups = { [action.context.group]: { [action.context.title]: [ action.id ] } };
21
    const reporter = new Reporter();
22
    const map = new Map([ [ action.id, action ] ]);
23
24
    await reporter._init();
25
    compareTexts(
26
        reporter._generate(groups, map),
27
        fixtures.reports.apiBlueprint.createUser
28
    );
29
});
30
31