Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 43 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { assert } from 'chai'; |
||
2 | import { load } from '../utils'; |
||
3 | import toArrayAST from '../files/jsdoc/function-toArray.ast.json'; |
||
4 | import toArrayJSDOC from '../files/jsdoc/function-toArray.jsdoc.json'; |
||
5 | import uniqueIdFilterAST from '../files/jsdoc/const-uniqueIdFilter.ast.json'; |
||
6 | import uniqueIdFilterJSDOC from '../files/jsdoc/const-uniqueIdFilter.jsdoc.json'; |
||
7 | import fillAST from '../files/jsdoc/todo-fill.ast.json'; |
||
8 | import fillJSDOC from '../files/jsdoc/todo-fill.jsdoc.json'; |
||
9 | import unparsableAST from '../files/jsdoc/unparsable.ast.json'; |
||
10 | |||
11 | const { extractJSDOC } = load('utils/jsdocUtils'); |
||
12 | |||
13 | suite('jsdocUtils'); |
||
14 | |||
15 | test('Positive: jsdoc on function', async function () { |
||
16 | assert.deepEqual( |
||
17 | await extractJSDOC(toArrayAST), |
||
18 | toArrayJSDOC |
||
19 | ); |
||
20 | }); |
||
21 | |||
22 | test('Positive: jsdoc on constant', async function () { |
||
23 | assert.deepEqual( |
||
24 | await extractJSDOC(uniqueIdFilterAST), |
||
25 | uniqueIdFilterJSDOC |
||
26 | ); |
||
27 | }); |
||
28 | |||
29 | test('Positive: jsdoc on todo comment', async function () { |
||
30 | const jsdoc = await extractJSDOC(fillAST); |
||
31 | |||
32 | assert.deepEqual( |
||
33 | jsdoc, |
||
34 | fillJSDOC |
||
35 | ); |
||
36 | }); |
||
37 | |||
38 | test('Negative: ignore unparsable types', async function () { |
||
39 | assert.deepEqual( |
||
40 | await extractJSDOC(unparsableAST), |
||
41 | [] |
||
42 | ); |
||
43 | }); |
||
44 |