@@ -153,22 +153,38 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
153153 checker . cases ( [
154154 /* jshint ignore:start */
155155 {
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)' ,
157161 code : [
158- 'export default function named (v) { ' ,
159- '};' ,
162+ '/** Foo bar */ ' ,
163+ 'export default function named (v) { };' ,
160164 ] . join ( '\n' ) ,
165+ errors : 0 ,
166+ } , {
167+ it : 'should report jsdoc absence for named function export (#159)' ,
168+ code : 'export function named (v) {};' ,
161169 errors : 1 ,
162170 } , {
163171 it : 'should not report jsdoc absence for named function export (#159)' ,
164172 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) => {};' ,
170187 ] . join ( '\n' ) ,
171- errors : 0 ,
172188 } ,
173189 /* jshint ignore:end */
174190 ] ) ;
@@ -196,11 +212,21 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
196212 checker . cases ( [
197213 /* jshint ignore:start */
198214 {
215+ it : 'should not report jsdoc absence for default named function export (#159)' ,
216+ code : 'export default function named (v) {};' ,
217+ errors : 0 ,
218+ } , {
199219 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) => {};' ,
204230 errors : 0 ,
205231 }
206232 /* jshint ignore:end */
0 commit comments