test/parsers/util.spec.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 17
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
c 1
b 0
f 0
nc 1
mnd 0
bc 2
fnc 2
dl 0
loc 17
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A util.spec.js ➔ ??? 0 12 1
1
import test from 'ava';
2
import { flattenRoutes } from '../../src/parsers/util';
3
4
import { initialRoutes, expectedRoutes } from '../mock/routes';
5
6
test('flattenRoutes', t => {
7
    const flatRoutes = flattenRoutes(initialRoutes);
8
9
    flatRoutes.map( (flatRoute, index) => {
10
        t.deepEqual(
11
            flatRoutes[index],
12
            expectedRoutes[index],
13
            `should work for route with id ${expectedRoutes[index].id}`
14
        );
15
    })
16
17
});