@@ -147,6 +147,33 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
147147
148148 } ) ;
149149
150+ describe ( 'with true and esnext' , function ( ) {
151+ checker . rules ( { enforceExistence : true } , { esnext : true } ) ;
152+
153+ checker . cases ( [
154+ /* jshint ignore:start */
155+ {
156+ it : 'should report jsdoc absence for named function export (#159)' ,
157+ code : [
158+ 'export default function named (v) {' ,
159+ '};' ,
160+ ] . join ( '\n' ) ,
161+ errors : 1 ,
162+ } , {
163+ it : 'should not report jsdoc absence for named function export (#159)' ,
164+ code : [
165+ '/**' ,
166+ ' * Foo bar' ,
167+ ' */' ,
168+ 'export default function named (v) {' ,
169+ '};' ,
170+ ] . join ( '\n' ) ,
171+ errors : 0 ,
172+ } ,
173+ /* jshint ignore:end */
174+ ] ) ;
175+ } ) ;
176+
150177 describe ( 'with exceptExports' , function ( ) {
151178 checker . rules ( { enforceExistence : 'exceptExports' } ) ;
152179
@@ -163,6 +190,23 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
163190 ] ) ;
164191 } ) ;
165192
193+ describe ( 'with exceptExports and esnext' , function ( ) {
194+ checker . rules ( { enforceExistence : 'exceptExports' } , { esnext : true } ) ;
195+
196+ checker . cases ( [
197+ /* jshint ignore:start */
198+ {
199+ it : 'should not report jsdoc absence for named function export (#159)' ,
200+ code : [
201+ 'export default function named (v) {' ,
202+ '};' ,
203+ ] . join ( '\n' ) ,
204+ errors : 0 ,
205+ }
206+ /* jshint ignore:end */
207+ ] ) ;
208+ } ) ;
209+
166210 describe ( 'with allExcept exports' , function ( ) {
167211 checker . rules ( { enforceExistence : { allExcept : [ 'exports' ] } } ) ;
168212
0 commit comments