Skip to content

Commit b1f288d

Browse files
authored
Fix invalid ES6 test with multiple default exports (documentationjs#529)
The test had 2 default exports. Only 1 is allowed! Move the second default export to its own test fixture.
1 parent 895775d commit b1f288d

11 files changed

+163
-259
lines changed

test/fixture/es6-default2.input.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* @public
3+
*/
4+
export default (thisIsTheArgument) => {};

test/fixture/es6-default2.output.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[
2+
{
3+
"description": "",
4+
"tags": [
5+
{
6+
"title": "public",
7+
"description": null,
8+
"lineNumber": 1
9+
}
10+
],
11+
"loc": {
12+
"start": {
13+
"line": 1,
14+
"column": 0
15+
},
16+
"end": {
17+
"line": 3,
18+
"column": 3
19+
}
20+
},
21+
"context": {
22+
"loc": {
23+
"start": {
24+
"line": 4,
25+
"column": 0
26+
},
27+
"end": {
28+
"line": 4,
29+
"column": 41
30+
}
31+
}
32+
},
33+
"errors": [],
34+
"access": "public",
35+
"name": "es6-default2.input",
36+
"kind": "function",
37+
"params": [
38+
{
39+
"title": "param",
40+
"name": "thisIsTheArgument",
41+
"lineNumber": 4
42+
}
43+
],
44+
"members": {
45+
"instance": [],
46+
"static": []
47+
},
48+
"path": [
49+
{
50+
"name": "es6-default2.input",
51+
"kind": "function"
52+
}
53+
],
54+
"namespace": "es6-default2.input"
55+
}
56+
]

test/fixture/es6-default2.output.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2+
3+
# es6-default2.input
4+
5+
**Parameters**
6+
7+
- `thisIsTheArgument`
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"type": "root",
3+
"children": [
4+
{
5+
"type": "html",
6+
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->"
7+
},
8+
{
9+
"depth": 1,
10+
"type": "heading",
11+
"children": [
12+
{
13+
"type": "text",
14+
"value": "es6-default2.input"
15+
}
16+
]
17+
},
18+
{
19+
"type": "strong",
20+
"children": [
21+
{
22+
"type": "text",
23+
"value": "Parameters"
24+
}
25+
]
26+
},
27+
{
28+
"ordered": false,
29+
"type": "list",
30+
"children": [
31+
{
32+
"type": "listItem",
33+
"children": [
34+
{
35+
"type": "paragraph",
36+
"children": [
37+
{
38+
"type": "inlineCode",
39+
"value": "thisIsTheArgument"
40+
},
41+
{
42+
"type": "text",
43+
"value": " "
44+
},
45+
{
46+
"type": "text",
47+
"value": " "
48+
}
49+
]
50+
}
51+
]
52+
}
53+
]
54+
}
55+
]
56+
}

test/fixture/es6-import.output.json

+20-74
Original file line numberDiff line numberDiff line change
@@ -2154,60 +2154,6 @@
21542154
],
21552155
"namespace": "foo"
21562156
},
2157-
{
2158-
"description": "",
2159-
"tags": [
2160-
{
2161-
"title": "public",
2162-
"description": null,
2163-
"lineNumber": 1
2164-
}
2165-
],
2166-
"loc": {
2167-
"start": {
2168-
"line": 102,
2169-
"column": 0
2170-
},
2171-
"end": {
2172-
"line": 104,
2173-
"column": 3
2174-
}
2175-
},
2176-
"context": {
2177-
"loc": {
2178-
"start": {
2179-
"line": 105,
2180-
"column": 0
2181-
},
2182-
"end": {
2183-
"line": 105,
2184-
"column": 41
2185-
}
2186-
}
2187-
},
2188-
"errors": [],
2189-
"access": "public",
2190-
"name": "es6.input",
2191-
"kind": "function",
2192-
"params": [
2193-
{
2194-
"title": "param",
2195-
"name": "thisIsTheArgument",
2196-
"lineNumber": 105
2197-
}
2198-
],
2199-
"members": {
2200-
"instance": [],
2201-
"static": []
2202-
},
2203-
"path": [
2204-
{
2205-
"name": "es6.input",
2206-
"kind": "function"
2207-
}
2208-
],
2209-
"namespace": "es6.input"
2210-
},
22112157
{
22122158
"description": {
22132159
"type": "root",
@@ -2274,22 +2220,22 @@
22742220
],
22752221
"loc": {
22762222
"start": {
2277-
"line": 107,
2223+
"line": 102,
22782224
"column": 0
22792225
},
22802226
"end": {
2281-
"line": 110,
2227+
"line": 105,
22822228
"column": 3
22832229
}
22842230
},
22852231
"context": {
22862232
"loc": {
22872233
"start": {
2288-
"line": 111,
2234+
"line": 106,
22892235
"column": 0
22902236
},
22912237
"end": {
2292-
"line": 111,
2238+
"line": 106,
22932239
"column": 38
22942240
}
22952241
}
@@ -2425,22 +2371,22 @@
24252371
"tags": [],
24262372
"loc": {
24272373
"start": {
2428-
"line": 113,
2374+
"line": 108,
24292375
"column": 0
24302376
},
24312377
"end": {
2432-
"line": 115,
2378+
"line": 110,
24332379
"column": 3
24342380
}
24352381
},
24362382
"context": {
24372383
"loc": {
24382384
"start": {
2439-
"line": 116,
2385+
"line": 111,
24402386
"column": 0
24412387
},
24422388
"end": {
2443-
"line": 118,
2389+
"line": 113,
24442390
"column": 1
24452391
}
24462392
}
@@ -2529,22 +2475,22 @@
25292475
],
25302476
"loc": {
25312477
"start": {
2532-
"line": 128,
2478+
"line": 123,
25332479
"column": 0
25342480
},
25352481
"end": {
2536-
"line": 131,
2482+
"line": 126,
25372483
"column": 3
25382484
}
25392485
},
25402486
"context": {
25412487
"loc": {
25422488
"start": {
2543-
"line": 132,
2489+
"line": 127,
25442490
"column": 0
25452491
},
25462492
"end": {
2547-
"line": 132,
2493+
"line": 127,
25482494
"column": 27
25492495
}
25502496
}
@@ -2627,22 +2573,22 @@
26272573
],
26282574
"loc": {
26292575
"start": {
2630-
"line": 134,
2576+
"line": 129,
26312577
"column": 0
26322578
},
26332579
"end": {
2634-
"line": 137,
2580+
"line": 132,
26352581
"column": 3
26362582
}
26372583
},
26382584
"context": {
26392585
"loc": {
26402586
"start": {
2641-
"line": 138,
2587+
"line": 133,
26422588
"column": 0
26432589
},
26442590
"end": {
2645-
"line": 138,
2591+
"line": 133,
26462592
"column": 24
26472593
}
26482594
}
@@ -2719,22 +2665,22 @@
27192665
"tags": [],
27202666
"loc": {
27212667
"start": {
2722-
"line": 146,
2668+
"line": 141,
27232669
"column": 0
27242670
},
27252671
"end": {
2726-
"line": 148,
2672+
"line": 143,
27272673
"column": 3
27282674
}
27292675
},
27302676
"context": {
27312677
"loc": {
27322678
"start": {
2733-
"line": 149,
2679+
"line": 144,
27342680
"column": 0
27352681
},
27362682
"end": {
2737-
"line": 149,
2683+
"line": 144,
27382684
"column": 42
27392685
}
27402686
}

test/fixture/es6-import.output.md

-6
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ This is an async method
117117

118118
# es6.input
119119

120-
**Parameters**
121-
122-
- `thisIsTheArgument`
123-
124-
# es6.input
125-
126120
This function returns the number one.
127121

128122
Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone

test/fixture/es6-import.output.md.json

-47
Original file line numberDiff line numberDiff line change
@@ -1807,53 +1807,6 @@
18071807
}
18081808
]
18091809
},
1810-
{
1811-
"type": "strong",
1812-
"children": [
1813-
{
1814-
"type": "text",
1815-
"value": "Parameters"
1816-
}
1817-
]
1818-
},
1819-
{
1820-
"ordered": false,
1821-
"type": "list",
1822-
"children": [
1823-
{
1824-
"type": "listItem",
1825-
"children": [
1826-
{
1827-
"type": "paragraph",
1828-
"children": [
1829-
{
1830-
"type": "inlineCode",
1831-
"value": "thisIsTheArgument"
1832-
},
1833-
{
1834-
"type": "text",
1835-
"value": " "
1836-
},
1837-
{
1838-
"type": "text",
1839-
"value": " "
1840-
}
1841-
]
1842-
}
1843-
]
1844-
}
1845-
]
1846-
},
1847-
{
1848-
"depth": 1,
1849-
"type": "heading",
1850-
"children": [
1851-
{
1852-
"type": "text",
1853-
"value": "es6.input"
1854-
}
1855-
]
1856-
},
18571810
{
18581811
"type": "paragraph",
18591812
"children": [

0 commit comments

Comments
 (0)