Skip to content

Commit f71d562

Browse files
committed
[Test] prop-types: add a test case
1 parent b62259f commit f71d562

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/lib/rules/prop-types.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6095,6 +6095,19 @@ ruleTester.run('prop-types', rule, {
60956095
},
60966096
],
60976097
},
6098+
{
6099+
code: `
6100+
var thePropsTypes = {a: PropTypes.string.isRequired};
6101+
var Foo = function (props) { return <div>{props.a}{props.b}</div>; };
6102+
Foo.propTypes = thePropsTypes;
6103+
`,
6104+
errors: [
6105+
{
6106+
messageId: 'missingPropType',
6107+
data: { name: 'b' },
6108+
},
6109+
],
6110+
},
60986111
{
60996112
code: `
61006113
class Test extends Foo.Component {

0 commit comments

Comments
 (0)