@@ -806,6 +806,31 @@ describe("eslint", function() {
806
806
} , / N o d e m u s t b e a n o b j e c t $ / ) ;
807
807
} ) ;
808
808
809
+ it ( "should throw an error if fix is passed but meta has no `fixable` property" , function ( ) {
810
+ var meta = {
811
+ docs : { } ,
812
+ schema : [ ]
813
+ } ;
814
+
815
+ eslint . on ( "Program" , function ( node ) {
816
+ eslint . report ( "test-rule" , 2 , node , "hello world" , [ ] , { range : [ 1 , 1 ] , text : "" } , meta ) ;
817
+ } ) ;
818
+
819
+ assert . throws ( function ( ) {
820
+ eslint . verify ( "0" , config , "" , true ) ;
821
+ } , / F i x a b l e r u l e s s h o u l d e x p o r t a ` m e t a \. f i x a b l e ` p r o p e r t y .$ / ) ;
822
+ } ) ;
823
+
824
+ it ( "should not throw an error if fix is passed and no metadata is passed" , function ( ) {
825
+ eslint . on ( "Program" , function ( node ) {
826
+ eslint . report ( "test-rule" , 2 , node , "hello world" , [ ] , { range : [ 1 , 1 ] , text : "" } ) ;
827
+ } ) ;
828
+
829
+ assert . doesNotThrow ( function ( ) {
830
+ eslint . verify ( "0" , config , "" , true ) ;
831
+ } ) ;
832
+ } ) ;
833
+
809
834
it ( "should correctly parse a message with object keys as numbers" , function ( ) {
810
835
eslint . on ( "Program" , function ( node ) {
811
836
eslint . report ( "test-rule" , 2 , node , "my message {{name}}{{0}}" , { 0 : "!" , name : "testing" } ) ;
0 commit comments