Skip to content

Commit b7875c2

Browse files
authored
fix: arrow functions should be ignored (#79)
Fix #78
1 parent 8eaa38f commit b7875c2

File tree

8 files changed

+90
-35
lines changed

8 files changed

+90
-35
lines changed

cypress/integration/renderers/default.spec.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,23 @@ describe('Renderers: default', () => {
9090
.get('@table-data')
9191
.find('> tbody > tr')
9292
.then(($rows) => {
93-
const $rowChildren = $rows.eq(0).children();
93+
const $firstRowChildren = $rows.eq(0).children();
94+
const $secondRowChildren = $rows.eq(1).children();
95+
const $thirdRowChildren = $rows.eq(2).children();
9496

95-
expect($rows).to.have.length(1);
97+
expect($rows).to.have.length(3);
9698

97-
expect($rowChildren.eq(0).html()).to.eq('<b>message</b>');
98-
expect($rowChildren.eq(1).html()).to.eq('String');
99-
expect($rowChildren.eq(2).html()).to.eq('A message');
99+
expect($firstRowChildren.eq(0).html()).to.eq('<b>fooList</b>');
100+
expect($firstRowChildren.eq(1).html()).to.eq('Array');
101+
expect($firstRowChildren.eq(2).html()).to.eq('A list of foo');
102+
103+
expect($secondRowChildren.eq(0).html()).to.eq('<b>barList</b>');
104+
expect($secondRowChildren.eq(1).html()).to.eq('Array');
105+
expect($secondRowChildren.eq(2).html()).to.eq('A list of bar');
106+
107+
expect($thirdRowChildren.eq(0).html()).to.eq('<b>message</b>');
108+
expect($thirdRowChildren.eq(1).html()).to.eq('String');
109+
expect($thirdRowChildren.eq(2).html()).to.eq('A message');
100110
});
101111
});
102112

@@ -107,21 +117,21 @@ describe('Renderers: default', () => {
107117
.contains('decrement()')
108118
.next('.description')
109119
.next('.details')
110-
.find('a[href="BetterCounter.vue.html#line43"]', 'line 43');
120+
.find('a[href="BetterCounter.vue.html#line51"]', 'line 51');
111121

112122
cy.get('#increment')
113123
.contains('increment()')
114124
.next('.description')
115125
.next('.details')
116-
.find('a[href="BetterCounter.vue.html#line36"]', 'line 36');
126+
.find('a[href="BetterCounter.vue.html#line44"]', 'line 44');
117127

118128
cy.get('#showDialog')
119129
.contains('showDialog(counter)')
120130
.next('.description')
121131
.next('h5')
122132
.next('.params')
123133
.next('.details')
124-
.find('a[href="BetterCounter.vue.html#line51"]', 'line 51');
134+
.find('a[href="BetterCounter.vue.html#line59"]', 'line 59');
125135

126136
cy.contains('created()').should('not.exist');
127137
});

cypress/integration/renderers/docstrap.spec.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,23 @@ describe('Renderers: docstrap', () => {
9090
.get('@table-data')
9191
.find('> tbody > tr')
9292
.then(($rows) => {
93-
const $rowChildren = $rows.eq(0).children();
93+
const $firstRowChildren = $rows.eq(0).children();
94+
const $secondRowChildren = $rows.eq(1).children();
95+
const $thirdRowChildren = $rows.eq(2).children();
9496

95-
expect($rows).to.have.length(1);
97+
expect($rows).to.have.length(3);
9698

97-
expect($rowChildren.eq(0).html()).to.eq('<b>message</b>');
98-
expect($rowChildren.eq(1).html()).to.eq('String');
99-
expect($rowChildren.eq(2).html()).to.eq('A message');
99+
expect($firstRowChildren.eq(0).html()).to.eq('<b>fooList</b>');
100+
expect($firstRowChildren.eq(1).html()).to.eq('Array');
101+
expect($firstRowChildren.eq(2).html()).to.eq('A list of foo');
102+
103+
expect($secondRowChildren.eq(0).html()).to.eq('<b>barList</b>');
104+
expect($secondRowChildren.eq(1).html()).to.eq('Array');
105+
expect($secondRowChildren.eq(2).html()).to.eq('A list of bar');
106+
107+
expect($thirdRowChildren.eq(0).html()).to.eq('<b>message</b>');
108+
expect($thirdRowChildren.eq(1).html()).to.eq('String');
109+
expect($thirdRowChildren.eq(2).html()).to.eq('A message');
100110
});
101111
});
102112

@@ -107,21 +117,21 @@ describe('Renderers: docstrap', () => {
107117
.parent()
108118
.next('dd')
109119
.find('.details')
110-
.find('a[href="BetterCounter.vue.html#sunlight-1-line-43"]', 'line 43');
120+
.find('a[href="BetterCounter.vue.html#sunlight-1-line-51"]', 'line 51');
111121

112122
cy.get('#increment')
113123
.contains('increment()')
114124
.parent()
115125
.next('dd')
116126
.find('.details')
117-
.find('a[href="BetterCounter.vue.html#sunlight-1-line-36"]', 'line 36');
127+
.find('a[href="BetterCounter.vue.html#sunlight-1-line-44"]', 'line 44');
118128

119129
cy.get('#showDialog')
120130
.contains('showDialog(counter)')
121131
.parent()
122132
.next('dd')
123133
.find('.details')
124-
.find('a[href="BetterCounter.vue.html#sunlight-1-line-51"]', 'line 51');
134+
.find('a[href="BetterCounter.vue.html#sunlight-1-line-59"]', 'line 59');
125135

126136
cy.contains('created()').should('not.exist');
127137
});

cypress/integration/renderers/minami.spec.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,26 @@ describe('Renderers: minami', () => {
9393
.get('@table-data')
9494
.find('> tbody > tr')
9595
.then(($rows) => {
96-
const $rowChildren = $rows.eq(0).children();
96+
const $firstRowChildren = $rows.eq(0).children();
97+
const $secondRowChildren = $rows.eq(1).children();
98+
const $thirdRowChildren = $rows.eq(2).children();
9799

98-
expect($rows).to.have.length(1);
100+
expect($rows).to.have.length(3);
101+
102+
expect($firstRowChildren.eq(0).html()).to.eq('fooList');
103+
expect($firstRowChildren.eq(0).attr('class')).to.eq('name');
104+
expect($firstRowChildren.eq(1).html()).to.eq('Array');
105+
expect($firstRowChildren.eq(2).html()).to.eq('A list of foo');
106+
107+
expect($secondRowChildren.eq(0).html()).to.eq('barList');
108+
expect($secondRowChildren.eq(0).attr('class')).to.eq('name');
109+
expect($secondRowChildren.eq(1).html()).to.eq('Array');
110+
expect($secondRowChildren.eq(2).html()).to.eq('A list of bar');
99111

100-
expect($rowChildren.eq(0).html()).to.eq('message');
101-
expect($rowChildren.eq(0).attr('class')).to.eq('name');
102-
expect($rowChildren.eq(1).html()).to.eq('String');
103-
expect($rowChildren.eq(2).html()).to.eq('A message');
112+
expect($thirdRowChildren.eq(0).html()).to.eq('message');
113+
expect($thirdRowChildren.eq(0).attr('class')).to.eq('name');
114+
expect($thirdRowChildren.eq(1).html()).to.eq('String');
115+
expect($thirdRowChildren.eq(2).html()).to.eq('A message');
104116
});
105117
});
106118

@@ -110,19 +122,19 @@ describe('Renderers: minami', () => {
110122
.contains('decrement()')
111123
.next('.description')
112124
.next('.details')
113-
.find('a[href="BetterCounter.vue.html#line43"]', 'line 43');
125+
.contains('a[href="BetterCounter.vue.html#line51"]', 'line 51');
114126

115127
cy.get('#increment')
116128
.contains('increment()')
117129
.next('.description')
118130
.next('.details')
119-
.find('a[href="BetterCounter.vue.html#line36"]', 'line 36');
131+
.contains('a[href="BetterCounter.vue.html#line44"]', 'line 44');
120132

121133
cy.get('#showDialog')
122134
.contains('showDialog(counter)')
123135
.next('.description')
124136
.next('.details')
125-
.find('a[href="BetterCounter.vue.html#line51"]', 'line 51');
137+
.contains('a[href="BetterCounter.vue.html#line59"]', 'line 59');
126138

127139
cy.contains('created()').should('not.exist');
128140
});

cypress/integration/renderers/tui.spec.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,29 +90,39 @@ describe('Renderers: tui', () => {
9090
.get('@table-data')
9191
.find('> tbody > tr')
9292
.then(($rows) => {
93-
const $rowChildren = $rows.eq(0).children();
93+
const $firstRowChildren = $rows.eq(0).children();
94+
const $secondRowChildren = $rows.eq(1).children();
95+
const $thirdRowChildren = $rows.eq(2).children();
9496

95-
expect($rows).to.have.length(1);
97+
expect($rows).to.have.length(3);
9698

97-
expect($rowChildren.eq(0).html()).to.eq('<b>message</b>');
98-
expect($rowChildren.eq(1).html()).to.eq('String');
99-
expect($rowChildren.eq(2).html()).to.eq('A message');
99+
expect($firstRowChildren.eq(0).html()).to.eq('<b>fooList</b>');
100+
expect($firstRowChildren.eq(1).html()).to.eq('Array');
101+
expect($firstRowChildren.eq(2).html()).to.eq('A list of foo');
102+
103+
expect($secondRowChildren.eq(0).html()).to.eq('<b>barList</b>');
104+
expect($secondRowChildren.eq(1).html()).to.eq('Array');
105+
expect($secondRowChildren.eq(2).html()).to.eq('A list of bar');
106+
107+
expect($thirdRowChildren.eq(0).html()).to.eq('<b>message</b>');
108+
expect($thirdRowChildren.eq(1).html()).to.eq('String');
109+
expect($thirdRowChildren.eq(2).html()).to.eq('A message');
100110
});
101111
});
102112

103113
it('should render methods properly', () => {
104114
cy.contains('h3', 'Methods').should('have.attr', 'class', 'subsection-title');
105115
cy.get('#decrement')
106116
.contains('decrement()')
107-
.contains('a[href="BetterCounter.vue.html#line43"]', 'line 43');
117+
.contains('a[href="BetterCounter.vue.html#line51"]', 'line 51');
108118

109119
cy.get('#increment')
110120
.contains('increment()')
111-
.contains('a[href="BetterCounter.vue.html#line36"]', 'line 36');
121+
.contains('a[href="BetterCounter.vue.html#line44"]', 'line 44');
112122

113123
cy.get('#showDialog')
114124
.contains('showDialog(counter)')
115-
.contains('a[href="BetterCounter.vue.html#line51"]', 'line 51');
125+
.contains('a[href="BetterCounter.vue.html#line59"]', 'line 59');
116126

117127
cy.contains('created()').should('not.exist');
118128
});

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"ink-docstrap": "^1.3.2",
1010
"jsdoc": "^3.5.5",
1111
"minami": "^1.2.3",
12-
"tui-jsdoc-template": "^1.2.2"
12+
"tui-jsdoc-template": "^1.2.2",
13+
"vuex": "^3.0.1"
1314
}
1415
}

example/src/BetterCounter.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
</template>
99

1010
<script>
11+
import { mapState } from 'vuex';
12+
1113
/**
1214
* @vue-prop {Number} initialCounter
1315
* @vue-prop {Number} [step=1] Step
1416
* @vue-data {Number} counter - Current counter's value
17+
* @vue-computed {Array} fooList - A list of foo
18+
* @vue-computed {Array} barList - A list of bar
1519
* @vue-computed {String} message A message
1620
*/
1721
export default {
@@ -25,6 +29,10 @@
2529
}
2630
},
2731
computed: {
32+
...mapState({
33+
fooList: state => state.$_foo.fooList,
34+
barList: state => state.$_foo.barList
35+
}),
2836
message() {
2937
return `Counter: ${this.counter}`
3038
}

example/yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ util-deprecate@~1.0.1:
396396
version "1.0.2"
397397
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
398398

399+
vuex@^3.0.1:
400+
version "3.0.1"
401+
resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2"
402+
399403
xmlcreate@^1.0.1:
400404
version "1.0.2"
401405
resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-1.0.2.tgz#fa6bf762a60a413fb3dd8f4b03c5b269238d308f"

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports.handlers = {
4646
}
4747

4848
// Methods and hooks
49-
if (e.doclet.kind === 'function') {
49+
if (e.doclet.kind === 'function' && 'memberof' in e.doclet) {
5050
if (e.doclet.memberof.endsWith('.methods')) {
5151
e.doclet.scope = 'instance';
5252
e.doclet.memberof = e.doclet.memberof.replace(/\.methods$/, ''); // force method to be displayed

0 commit comments

Comments
 (0)