diff --git a/tests/lib/rules/boolean-prop-naming.js b/tests/lib/rules/boolean-prop-naming.js index abbfb8a91b..ed0a364089 100644 --- a/tests/lib/rules/boolean-prop-naming.js +++ b/tests/lib/rules/boolean-prop-naming.js @@ -578,5 +578,41 @@ ruleTester.run('boolean-prop-naming', rule, { errors: [{ message: 'Prop name (showScore) doesn\'t match rule (^(is|has)[A-Z]([A-Za-z0-9]?)+)' }] + }, { + code: ` + function Card(props) { + return
{props.showScore ? 'yeh' : 'no'}
; + } + Card.propTypes = forbidExtraProps({ + showScore: PropTypes.bool + });`, + settings: { + propWrapperFunctions: ['forbidExtraProps'] + }, + options: [{ + rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+' + }], + errors: [{ + message: 'Prop name (showScore) doesn\'t match rule (^(is|has)[A-Z]([A-Za-z0-9]?)+)' + }] + }, { + code: ` + class Card extends React.Component { + render() { + return
{props.showScore ? 'yeh' : 'no'}
; + } + } + Card.propTypes = forbidExtraProps({ + showScore: PropTypes.bool + });`, + settings: { + propWrapperFunctions: ['forbidExtraProps'] + }, + options: [{ + rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+' + }], + errors: [{ + message: 'Prop name (showScore) doesn\'t match rule (^(is|has)[A-Z]([A-Za-z0-9]?)+)' + }] }] });