Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests]prop-types: add passing test case about array.length #2290

Merged
merged 1 commit into from May 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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