Skip to content

Commit 1b307d3

Browse files
committed
[Tests] prop-types: add passing test
Closes #2135
1 parent 9b227aa commit 1b307d3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/lib/rules/prop-types.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3810,6 +3810,21 @@ ruleTester.run('prop-types', rule, {
38103810
}
38113811
}
38123812
`,
3813+
},
3814+
{
3815+
code: `
3816+
const DisplayName = (props) => {
3817+
const getNameDiv = () => {
3818+
return <div>{props.name}</div>;
3819+
};
3820+
3821+
return getNameDiv();
3822+
};
3823+
3824+
DisplayName.propTypes = {
3825+
name: PropTypes.string.isRequired,
3826+
};
3827+
`,
38133828
}
38143829
)),
38153830

0 commit comments

Comments
 (0)