Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 17 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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 | }); |