Skip to content

Commit

Permalink
[Tests]prop-types: add passing test case about array.length
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot committed May 26, 2019
1 parent 2f6d828 commit a131363
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/lib/rules/prop-types.js
Expand Up @@ -483,6 +483,20 @@ ruleTester.run('prop-types', rule, {
' )',
'};'
].join('\n')
}, {
code: `
class ArrayLengthTest extends React.Component {
render() {
use(this.props.arr.length)
use(this.props.arr2.length)
return <div />
}
}
ArrayLengthTest.propTypes = {
arr: PropTypes.array,
arr2: PropTypes.arrayOf(PropTypes.number),
}`
}, {
code: [
'var TestComp1 = createReactClass({',
Expand Down

0 comments on commit a131363

Please sign in to comment.