3
3
const common = require ( '../common' ) ;
4
4
const assert = require ( 'assert' ) ;
5
5
const fs = require ( 'fs' ) ;
6
+ const path = require ( 'path' ) ;
6
7
7
8
const json = require ( '../../tools/doc/json.js' ) ;
8
9
@@ -12,113 +13,116 @@ const json = require('../../tools/doc/json.js');
12
13
// The json property is some json which will be generated by the doctool.
13
14
var testData = [
14
15
{
15
- 'file' : common . fixturesDir + '/sample_document.md' ,
16
- 'json' : {
17
- 'source' : 'foo' ,
18
- 'modules' : [ { 'textRaw' : 'Sample Markdown' ,
19
- 'name' : 'sample_markdown' ,
20
- 'modules' : [ { 'textRaw' : 'Seussian Rhymes' ,
21
- 'name' : 'seussian_rhymes' ,
22
- 'desc' : '<ol>\n<li>fish</li>\n<li><p>fish</p>\n</li>\n<li>' +
16
+ file : path . join ( common . fixturesDir , 'sample_document.md' ) ,
17
+ json : {
18
+ source : 'foo' ,
19
+ modules : [ {
20
+ textRaw : 'Sample Markdown' ,
21
+ name : 'sample_markdown' ,
22
+ modules : [ {
23
+ textRaw : 'Seussian Rhymes' ,
24
+ name : 'seussian_rhymes' ,
25
+ desc : '<ol>\n<li>fish</li>\n<li><p>fish</p>\n</li>\n<li>' +
23
26
'<p>Red fish</p>\n</li>\n<li>Blue fish</li>\n</ol>\n' ,
24
- ' type' : 'module' ,
25
- ' displayName' : 'Seussian Rhymes'
26
- } ] ,
27
- ' type' : 'module' ,
28
- ' displayName' : 'Sample Markdown'
29
- } ]
27
+ type : 'module' ,
28
+ displayName : 'Seussian Rhymes'
29
+ } ] ,
30
+ type : 'module' ,
31
+ displayName : 'Sample Markdown'
32
+ } ]
30
33
}
31
34
} ,
32
35
{
33
- 'file' : common . fixturesDir + '/order_of_end_tags_5873.md' ,
34
- 'json' : {
35
- 'source' : 'foo' ,
36
- 'modules' : [ {
37
- 'textRaw' : 'Title' ,
38
- 'name' : 'title' ,
39
- 'modules' : [ {
40
- 'textRaw' : 'Subsection' ,
41
- 'name' : 'subsection' ,
42
- 'classMethods' : [ {
43
- 'textRaw' : 'Class Method: Buffer.from(array)' ,
44
- 'type' : 'classMethod' ,
45
- 'name' : 'from' ,
46
- 'signatures' : [ {
47
- 'params' : [ {
48
- 'textRaw' : '`array` {Array} ' ,
49
- 'name' : 'array' ,
50
- 'type' : 'Array'
51
- } ]
52
- } ,
36
+ file : path . join ( common . fixturesDir , 'order_of_end_tags_5873.md' ) ,
37
+ json : {
38
+ source : 'foo' ,
39
+ modules : [ {
40
+ textRaw : 'Title' ,
41
+ name : 'title' ,
42
+ modules : [ {
43
+ textRaw : 'Subsection' ,
44
+ name : 'subsection' ,
45
+ classMethods : [ {
46
+ textRaw : 'Class Method: Buffer.from(array)' ,
47
+ type : 'classMethod' ,
48
+ name : 'from' ,
49
+ signatures : [
50
+ {
51
+ params : [ {
52
+ textRaw : '`array` {Array} ' ,
53
+ name : 'array' ,
54
+ type : 'Array'
55
+ } ]
56
+ } ,
53
57
{
54
- ' params' : [ {
55
- ' name' : 'array'
56
- } ]
58
+ params : [ {
59
+ name : 'array'
60
+ } ]
57
61
}
58
62
]
59
- } ] ,
60
- ' type' : 'module' ,
61
- ' displayName' : 'Subsection'
62
- } ] ,
63
- ' type' : 'module' ,
64
- ' displayName' : 'Title'
65
- } ]
63
+ } ] ,
64
+ type : 'module' ,
65
+ displayName : 'Subsection'
66
+ } ] ,
67
+ type : 'module' ,
68
+ displayName : 'Title'
69
+ } ]
66
70
}
67
71
} ,
68
72
{
69
- ' file' : common . fixturesDir + '/ doc_with_yaml.md',
70
- ' json' : {
71
- ' source' : 'foo' ,
72
- ' modules' : [
73
+ file : path . join ( common . fixturesDir , ' doc_with_yaml.md') ,
74
+ json : {
75
+ source : 'foo' ,
76
+ modules : [
73
77
{
74
- ' textRaw' : 'Sample Markdown with YAML info' ,
75
- ' name' : 'sample_markdown_with_yaml_info' ,
76
- ' modules' : [
78
+ textRaw : 'Sample Markdown with YAML info' ,
79
+ name : 'sample_markdown_with_yaml_info' ,
80
+ modules : [
77
81
{
78
- ' textRaw' : 'Foobar' ,
79
- ' name' : 'foobar' ,
80
- ' meta' : {
81
- ' added' : [ 'v1.0.0' ]
82
+ textRaw : 'Foobar' ,
83
+ name : 'foobar' ,
84
+ meta : {
85
+ added : [ 'v1.0.0' ]
82
86
} ,
83
- ' desc' : '<p>Describe <code>Foobar</code> in more detail ' +
87
+ desc : '<p>Describe <code>Foobar</code> in more detail ' +
84
88
'here.</p>\n' ,
85
- ' type' : 'module' ,
86
- ' displayName' : 'Foobar'
89
+ type : 'module' ,
90
+ displayName : 'Foobar'
87
91
} ,
88
92
{
89
- ' textRaw' : 'Foobar II' ,
90
- ' name' : 'foobar_ii' ,
91
- ' meta' : {
92
- ' added' : [ 'v5.3.0' , 'v4.2.0' ]
93
+ textRaw : 'Foobar II' ,
94
+ name : 'foobar_ii' ,
95
+ meta : {
96
+ added : [ 'v5.3.0' , 'v4.2.0' ]
93
97
} ,
94
- ' desc' : '<p>Describe <code>Foobar II</code> in more detail ' +
98
+ desc : '<p>Describe <code>Foobar II</code> in more detail ' +
95
99
'here.</p>\n' ,
96
- ' type' : 'module' ,
97
- ' displayName' : 'Foobar II'
100
+ type : 'module' ,
101
+ displayName : 'Foobar II'
98
102
} ,
99
103
{
100
- ' textRaw' : 'Deprecated thingy' ,
101
- ' name' : 'deprecated_thingy' ,
102
- ' meta' : {
103
- ' added' : [ 'v1.0.0' ] ,
104
- ' deprecated' : [ 'v2.0.0' ]
104
+ textRaw : 'Deprecated thingy' ,
105
+ name : 'deprecated_thingy' ,
106
+ meta : {
107
+ added : [ 'v1.0.0' ] ,
108
+ deprecated : [ 'v2.0.0' ]
105
109
} ,
106
- ' desc' : '<p>Describe <code>Deprecated thingy</code> in more ' +
110
+ desc : '<p>Describe <code>Deprecated thingy</code> in more ' +
107
111
'detail here.</p>\n' ,
108
- ' type' : 'module' ,
109
- ' displayName' : 'Deprecated thingy'
112
+ type : 'module' ,
113
+ displayName : 'Deprecated thingy'
110
114
} ,
111
115
{
112
- ' textRaw' : 'Something' ,
113
- ' name' : 'something' ,
114
- ' desc' : '<!-- This is not a metadata comment -->\n<p>' +
116
+ textRaw : 'Something' ,
117
+ name : 'something' ,
118
+ desc : '<!-- This is not a metadata comment -->\n<p>' +
115
119
'Describe <code>Something</code> in more detail here.</p>\n' ,
116
- ' type' : 'module' ,
117
- ' displayName' : 'Something'
120
+ type : 'module' ,
121
+ displayName : 'Something'
118
122
}
119
123
] ,
120
- ' type' : 'module' ,
121
- ' displayName' : 'Sample Markdown with YAML info'
124
+ type : 'module' ,
125
+ displayName : 'Sample Markdown with YAML info'
122
126
}
123
127
]
124
128
}
0 commit comments