@@ -153,22 +153,38 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
153
153
checker . cases ( [
154
154
/* jshint ignore:start */
155
155
{
156
- it : 'should report jsdoc absence for named function export (#159)' ,
156
+ it : 'should report jsdoc absence for default named function export (#159)' ,
157
+ code : 'export default function named (v) {};' ,
158
+ errors : 1 ,
159
+ } , {
160
+ it : 'should not report jsdoc absence for default named function export (#159)' ,
157
161
code : [
158
- 'export default function named (v) { ' ,
159
- '};' ,
162
+ '/** Foo bar */ ' ,
163
+ 'export default function named (v) { };' ,
160
164
] . join ( '\n' ) ,
165
+ errors : 0 ,
166
+ } , {
167
+ it : 'should report jsdoc absence for named function export (#159)' ,
168
+ code : 'export function named (v) {};' ,
161
169
errors : 1 ,
162
170
} , {
163
171
it : 'should not report jsdoc absence for named function export (#159)' ,
164
172
code : [
165
- '/**' ,
166
- ' * Foo bar' ,
167
- ' */' ,
168
- 'export default function named (v) {' ,
169
- '};' ,
173
+ '/** Foo bar */' ,
174
+ 'export function named (v) {};' ,
175
+ ] . join ( '\n' ) ,
176
+ } , {
177
+ skip : true ,
178
+ it : 'should report jsdoc absence for default arrow function export (#159)' ,
179
+ code : 'export default (v) => {};' ,
180
+ errors : 1 ,
181
+ } , {
182
+ skip : true ,
183
+ it : 'should not report jsdoc absence for default arrow function export (#159)' ,
184
+ code : [
185
+ '/** Foo bar */' ,
186
+ 'export default (v) => {};' ,
170
187
] . join ( '\n' ) ,
171
- errors : 0 ,
172
188
} ,
173
189
/* jshint ignore:end */
174
190
] ) ;
@@ -196,11 +212,21 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
196
212
checker . cases ( [
197
213
/* jshint ignore:start */
198
214
{
215
+ it : 'should not report jsdoc absence for default named function export (#159)' ,
216
+ code : 'export default function named (v) {};' ,
217
+ errors : 0 ,
218
+ } , {
199
219
it : 'should not report jsdoc absence for named function export (#159)' ,
200
- code : [
201
- 'export default function named (v) {' ,
202
- '};' ,
203
- ] . join ( '\n' ) ,
220
+ code : 'export function named (v) {};' ,
221
+ errors : 0 ,
222
+ } , {
223
+ it : 'should not report jsdoc absence for default anonymous function export (#159)' ,
224
+ code : 'export default function (v) {};' ,
225
+ errors : 0 ,
226
+ } , {
227
+ skip : true ,
228
+ it : 'should not report jsdoc absence for default arrow function export (#159)' ,
229
+ code : 'export default (v) => {};' ,
204
230
errors : 0 ,
205
231
}
206
232
/* jshint ignore:end */
0 commit comments