Skip to content

Commit 2e8ea16

Browse files
committed
Fix custom markdown formatter tests
1 parent 120491c commit 2e8ea16

25 files changed

+58
-91
lines changed

lib/markdown_helpers.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ function formatParameter(param) {
4545
* Format the parameters of a function into a quickly-readable
4646
* summary that resembles how you would call the function
4747
* initially.
48+
* @param {Object} args arguments from Handlebars
4849
* @returns {string} formatted type parameters
4950
*/
50-
function formatParameters() {
51-
if (!this.params) {
51+
function formatParameters(args) {
52+
var data = args.data.root;
53+
if (!data.params) {
5254
return '';
5355
}
54-
return '(' + this.params.map(function (param) {
56+
return '(' + data.params.map(function (param) {
5557
return formatParameter(param);
5658
}).join(', ') + ')';
5759
}

test/fixture/es6.output.custom.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ This function returns the number one.
44

55

66

7-
87
Returns `Number` numberone
98

test/fixture/event.output.custom.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ Mouse event
99
| `originalEvent` | `Event` | the original DOM event |
1010

1111

12-

test/fixture/external.output.custom.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## `foo`
22

3-
I am in `external.input.js`.
4-
3+
I am in `external.input.js`.
54

65

76

test/fixture/factory.output.custom.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ an area chart generator
44

55

66

7-
87
Returns `area` chart
98

109
## `area`
@@ -14,12 +13,10 @@ Returns `area` chart
1413

1514

1615

17-
1816
## `data`
1917

2018
Sets the chart data.
2119

2220

2321

2422

25-
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## `addOne`
1+
## `addOne(a)`
22

33
Adds one to a number
44

@@ -7,19 +7,17 @@ Adds one to a number
77
* `a` **`number`** the input
88

99

10-
1110
Returns `number` the output
1211

13-
## `exports`
12+
## `exports(a)`
1413

1514
This function returns the number one. Internally, this uses
16-
`addOne` to do the math.
15+
{@link addOne} to do the math.
1716

1817
### Parameters
1918

2019
* `a` **`number`** the input
2120

2221

23-
2422
Returns `number` numberone
2523

test/fixture/internal.output.custom.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## `foo`
22

3-
I am in `external.input.js`.
4-
3+
I am in `external.input.js`.
54

65

76

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## `setTime`
1+
## `setTime(time)`
22

33
Set the time
44

@@ -7,6 +7,5 @@ Set the time
77
* `time` **`Date`** the current time
88

99

10-
1110
Returns nothing
1211

test/fixture/multiexample.output.custom.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,5 @@ This function returns the number one.
44

55

66

7-
### Examples
8-
9-
```js
10-
foo(1);
11-
```
12-
```js
13-
foo(2);
14-
```
15-
167
Returns `Number` numberone
178

18-
| type | description |
19-
| ---- | ----------- |
20-
| `Error` | if you give it something |
21-
| `TypeError` | if you give it something else |

test/fixture/multisignature.output.custom.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ Get the time
44

55

66

7-
87
Returns `Date` the current date
98

10-
## `getTheTime`
9+
## `getTheTime(time)`
1110

1211
Set the time
1312

@@ -16,6 +15,5 @@ Set the time
1615
* `time` **`Date`** the current time
1716

1817

19-
2018
Returns nothing
2119

0 commit comments

Comments
 (0)