Skip to content

Commit

Permalink
Created test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri-sakharov committed Feb 3, 2018
1 parent 2839b5d commit dda03e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,20 @@ ruleTester.run('no-unused-prop-types', rule, {
'}'
].join('\n'),
parser: 'babel-eslint'
}, {
// Destructured props in componentWillReceiveProps shouldn't throw errors when used createReactClass
code: [
'var Hello = createReactClass({',
' propTypes: {',
' something: PropTypes.bool,',
' },',
' componentWillReceiveProps (nextProps) {',
' const {something} = nextProps;',
' doSomething(something);',
' }',
'})'
].join('\n'),
parser: 'babel-eslint'
}, {
// Destructured function props in componentWillReceiveProps shouldn't throw errors
code: [
Expand Down

0 comments on commit dda03e9

Please sign in to comment.