comment-parser 0.7.1 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +12 -0
- package/.vscode/launch.json +18 -0
- package/CHANGELOG.md +12 -0
- package/package.json +22 -10
- package/parser.js +0 -4
- package/parsers.js +19 -17
- package/stringifier.js +13 -6
- package/.travis.yml +0 -10
- package/tests/custom-parsers.spec.js +0 -132
- package/tests/files.spec.js +0 -69
- package/tests/fixtures/sample.js +0 -36
- package/tests/parse.js +0 -20
- package/tests/parse.spec.js +0 -1243
- package/tests/stringify.spec.js +0 -80
package/tests/stringify.spec.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { expect } = require('chai')
|
|
4
|
-
|
|
5
|
-
const parser = require('../')
|
|
6
|
-
|
|
7
|
-
describe('Comment stringifying', function () {
|
|
8
|
-
it('should stringify doc block with description', function () {
|
|
9
|
-
const expected = `/**
|
|
10
|
-
* Singleline or multiline description text. Line breaks are preserved.
|
|
11
|
-
*
|
|
12
|
-
* @some-tag {Type} name Singleline or multiline description text
|
|
13
|
-
* @some-tag {Type} name.subname Singleline or multiline description text
|
|
14
|
-
* @some-tag {Type} name.subname.subsubname Singleline or
|
|
15
|
-
* multiline description text
|
|
16
|
-
* @some-tag {Type} [optionalName=someDefault]
|
|
17
|
-
* @another-tag
|
|
18
|
-
*/`
|
|
19
|
-
const parsed = parser(expected)
|
|
20
|
-
|
|
21
|
-
expect(parsed).to.be.an('array')
|
|
22
|
-
|
|
23
|
-
const stringified = parser.stringify(parsed)
|
|
24
|
-
|
|
25
|
-
expect(stringified).to.eq(expected)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('should stringify indented doc block with description', function () {
|
|
29
|
-
const expected = ` /**
|
|
30
|
-
* Singleline or multiline description text. Line breaks are preserved.
|
|
31
|
-
*
|
|
32
|
-
* @some-tag {Type} name Singleline or multiline description text
|
|
33
|
-
* @some-tag {Type} name.subname Singleline or multiline description text
|
|
34
|
-
* @some-tag {Type} name.subname.subsubname Singleline or
|
|
35
|
-
* multiline description text
|
|
36
|
-
* @some-tag {Type} [optionalName=someDefault]
|
|
37
|
-
* @another-tag
|
|
38
|
-
*/`
|
|
39
|
-
const parsed = parser(expected)
|
|
40
|
-
|
|
41
|
-
expect(parsed).to.be.an('array')
|
|
42
|
-
|
|
43
|
-
const stringified = parser.stringify(parsed, { indent: ' ' })
|
|
44
|
-
|
|
45
|
-
expect(stringified).to.eq(expected)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('should stringify numeric indented doc block with description', function () {
|
|
49
|
-
const expected = ` /**
|
|
50
|
-
* Singleline or multiline description text. Line breaks are preserved.
|
|
51
|
-
*
|
|
52
|
-
* @some-tag {Type} name Singleline or multiline description text
|
|
53
|
-
* @some-tag {Type} name.subname Singleline or multiline description text
|
|
54
|
-
* @some-tag {Type} name.subname.subsubname Singleline or
|
|
55
|
-
* multiline description text
|
|
56
|
-
* @some-tag {Type} [optionalName=someDefault]
|
|
57
|
-
* @another-tag
|
|
58
|
-
*/`
|
|
59
|
-
const parsed = parser(expected)
|
|
60
|
-
|
|
61
|
-
expect(parsed).to.be.an('array')
|
|
62
|
-
|
|
63
|
-
const stringified = parser.stringify(parsed, { indent: 4 })
|
|
64
|
-
|
|
65
|
-
expect(stringified).to.eq(expected)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
it('should stringify numeric indented doc block without description', function () {
|
|
69
|
-
const expected = ` /**
|
|
70
|
-
* @param Foo
|
|
71
|
-
*/`
|
|
72
|
-
const parsed = parser(expected)
|
|
73
|
-
|
|
74
|
-
expect(parsed).to.be.an('array')
|
|
75
|
-
|
|
76
|
-
const stringified = parser.stringify(parsed, { indent: 4 })
|
|
77
|
-
|
|
78
|
-
expect(stringified).to.eq(expected)
|
|
79
|
-
})
|
|
80
|
-
})
|