Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 662c2f9

Browse files
arvtmcw
authored andcommitted
Testing: Support defining options for fixture tests (documentationjs#492)
This reads the fixture file and looks for ```js // Options: <JSON> ``` which it uses as the options for documentation.build and documentation.buildSync.
1 parent 06412ea commit 662c2f9

5 files changed

+26
-299
lines changed

test/fixture/infer-private.input.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Options: {"inferPrivate": "^_"}
2+
13
/**
24
* _p description
35
*/

test/fixture/infer-private.output.json

+8-197
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,4 @@
11
[
2-
{
3-
"description": {
4-
"type": "root",
5-
"children": [
6-
{
7-
"type": "paragraph",
8-
"children": [
9-
{
10-
"type": "text",
11-
"value": "_p description",
12-
"position": {
13-
"start": {
14-
"line": 1,
15-
"column": 1,
16-
"offset": 0
17-
},
18-
"end": {
19-
"line": 1,
20-
"column": 15,
21-
"offset": 14
22-
},
23-
"indent": []
24-
}
25-
}
26-
],
27-
"position": {
28-
"start": {
29-
"line": 1,
30-
"column": 1,
31-
"offset": 0
32-
},
33-
"end": {
34-
"line": 1,
35-
"column": 15,
36-
"offset": 14
37-
},
38-
"indent": []
39-
}
40-
}
41-
],
42-
"position": {
43-
"start": {
44-
"line": 1,
45-
"column": 1,
46-
"offset": 0
47-
},
48-
"end": {
49-
"line": 1,
50-
"column": 15,
51-
"offset": 14
52-
}
53-
}
54-
},
55-
"tags": [],
56-
"loc": {
57-
"start": {
58-
"line": 1,
59-
"column": 0
60-
},
61-
"end": {
62-
"line": 3,
63-
"column": 3
64-
}
65-
},
66-
"context": {
67-
"loc": {
68-
"start": {
69-
"line": 4,
70-
"column": 0
71-
},
72-
"end": {
73-
"line": 4,
74-
"column": 16
75-
}
76-
}
77-
},
78-
"errors": [],
79-
"name": "_p",
80-
"kind": "function",
81-
"members": {
82-
"instance": [],
83-
"static": []
84-
},
85-
"path": [
86-
{
87-
"name": "_p",
88-
"kind": "function"
89-
}
90-
],
91-
"namespace": "_p"
92-
},
932
{
943
"description": {
954
"type": "root",
@@ -146,22 +55,22 @@
14655
"tags": [],
14756
"loc": {
14857
"start": {
149-
"line": 6,
58+
"line": 8,
15059
"column": 0
15160
},
15261
"end": {
153-
"line": 6,
62+
"line": 8,
15463
"column": 20
15564
}
15665
},
15766
"context": {
15867
"loc": {
15968
"start": {
160-
"line": 7,
69+
"line": 9,
16170
"column": 0
16271
},
16372
"end": {
164-
"line": 12,
73+
"line": 14,
16574
"column": 1
16675
}
16776
}
@@ -227,22 +136,22 @@
227136
"tags": [],
228137
"loc": {
229138
"start": {
230-
"line": 8,
139+
"line": 10,
231140
"column": 2
232141
},
233142
"end": {
234-
"line": 8,
143+
"line": 10,
235144
"column": 22
236145
}
237146
},
238147
"context": {
239148
"loc": {
240149
"start": {
241-
"line": 9,
150+
"line": 11,
242151
"column": 2
243152
},
244153
"end": {
245-
"line": 9,
154+
"line": 11,
246155
"column": 8
247156
}
248157
}
@@ -268,104 +177,6 @@
268177
}
269178
],
270179
"namespace": "C#m"
271-
},
272-
{
273-
"description": {
274-
"type": "root",
275-
"children": [
276-
{
277-
"type": "paragraph",
278-
"children": [
279-
{
280-
"type": "text",
281-
"value": "_p description",
282-
"position": {
283-
"start": {
284-
"line": 1,
285-
"column": 1,
286-
"offset": 0
287-
},
288-
"end": {
289-
"line": 1,
290-
"column": 15,
291-
"offset": 14
292-
},
293-
"indent": []
294-
}
295-
}
296-
],
297-
"position": {
298-
"start": {
299-
"line": 1,
300-
"column": 1,
301-
"offset": 0
302-
},
303-
"end": {
304-
"line": 1,
305-
"column": 15,
306-
"offset": 14
307-
},
308-
"indent": []
309-
}
310-
}
311-
],
312-
"position": {
313-
"start": {
314-
"line": 1,
315-
"column": 1,
316-
"offset": 0
317-
},
318-
"end": {
319-
"line": 1,
320-
"column": 15,
321-
"offset": 14
322-
}
323-
}
324-
},
325-
"tags": [],
326-
"loc": {
327-
"start": {
328-
"line": 10,
329-
"column": 2
330-
},
331-
"end": {
332-
"line": 10,
333-
"column": 23
334-
}
335-
},
336-
"context": {
337-
"loc": {
338-
"start": {
339-
"line": 11,
340-
"column": 2
341-
},
342-
"end": {
343-
"line": 11,
344-
"column": 9
345-
}
346-
}
347-
},
348-
"errors": [],
349-
"name": "_p",
350-
"kind": "function",
351-
"memberof": "C",
352-
"scope": "instance",
353-
"members": {
354-
"instance": [],
355-
"static": []
356-
},
357-
"path": [
358-
{
359-
"name": "C",
360-
"kind": "class"
361-
},
362-
{
363-
"name": "_p",
364-
"kind": "function",
365-
"scope": "instance"
366-
}
367-
],
368-
"namespace": "C#_p"
369180
}
370181
],
371182
"static": [],

test/fixture/infer-private.output.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
22

3-
# \_p
4-
5-
\_p description
6-
73
# C
84

95
C description
106

117
## m
128

139
m description
14-
15-
## \_p
16-
17-
\_p description

test/fixture/infer-private.output.md.json

-90
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,6 @@
55
"type": "html",
66
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
77
},
8-
{
9-
"depth": 1,
10-
"type": "heading",
11-
"children": [
12-
{
13-
"type": "text",
14-
"value": "_p"
15-
}
16-
]
17-
},
18-
{
19-
"type": "paragraph",
20-
"children": [
21-
{
22-
"type": "text",
23-
"value": "_p description",
24-
"position": {
25-
"start": {
26-
"line": 1,
27-
"column": 1,
28-
"offset": 0
29-
},
30-
"end": {
31-
"line": 1,
32-
"column": 15,
33-
"offset": 14
34-
},
35-
"indent": []
36-
}
37-
}
38-
],
39-
"position": {
40-
"start": {
41-
"line": 1,
42-
"column": 1,
43-
"offset": 0
44-
},
45-
"end": {
46-
"line": 1,
47-
"column": 15,
48-
"offset": 14
49-
},
50-
"indent": []
51-
}
52-
},
538
{
549
"depth": 1,
5510
"type": "heading",
@@ -139,51 +94,6 @@
13994
},
14095
"indent": []
14196
}
142-
},
143-
{
144-
"depth": 2,
145-
"type": "heading",
146-
"children": [
147-
{
148-
"type": "text",
149-
"value": "_p"
150-
}
151-
]
152-
},
153-
{
154-
"type": "paragraph",
155-
"children": [
156-
{
157-
"type": "text",
158-
"value": "_p description",
159-
"position": {
160-
"start": {
161-
"line": 1,
162-
"column": 1,
163-
"offset": 0
164-
},
165-
"end": {
166-
"line": 1,
167-
"column": 15,
168-
"offset": 14
169-
},
170-
"indent": []
171-
}
172-
}
173-
],
174-
"position": {
175-
"start": {
176-
"line": 1,
177-
"column": 1,
178-
"offset": 0
179-
},
180-
"end": {
181-
"line": 1,
182-
"column": 15,
183-
"offset": 14
184-
},
185-
"indent": []
186-
}
18797
}
18898
]
18999
}

0 commit comments

Comments
 (0)