Skip to content

Commit c8915b1

Browse files
ajkovarljharb
authored andcommitted
[Tests] boolean-prop-naming: Added test for function invocation of bool
Closes #2602
1 parent 66d9604 commit c8915b1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/lib/rules/boolean-prop-naming.js

+15
Original file line numberDiff line numberDiff line change
@@ -900,5 +900,20 @@ ruleTester.run('boolean-prop-naming', rule, {
900900
errors: [{
901901
message: 'Prop name (failingItIs) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
902902
}]
903+
}, {
904+
code: `
905+
import { bool } from 'prop-types';
906+
var Hello = createReactClass({
907+
propTypes: {something: bool},
908+
render: function() { return <div />; }
909+
});
910+
`,
911+
options: [{
912+
rule: '^is[A-Z]([A-Za-z0-9]?)+',
913+
validateNested: true
914+
}],
915+
errors: [{
916+
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
917+
}]
903918
}]
904919
});

0 commit comments

Comments
 (0)