Skip to content

Commit

Permalink
Merge pull request #992 from taion/991-regression
Browse files Browse the repository at this point in the history
Add regression tests for #991
  • Loading branch information
ljharb authored Dec 5, 2016
2 parents 5948d59 + 6c3c245 commit 5372be3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,23 @@ ruleTester.run('prop-types', rule, {
'}'
].join('\n'),
parser: 'babel-eslint'
}, {
code: [
'class Hello extends React.Component {',
' async onSelect({ name }) {',
' return null;',
' }',
' render() {',
' return <Greeting onSelect={this.onSelect} />;',
' }',
'}'
].join('\n'),
parserOptions: {
ecmaVersion: 8,
ecmaFeatures: {
jsx: true
}
}
}
],

Expand Down Expand Up @@ -2530,6 +2547,21 @@ ruleTester.run('prop-types', rule, {
errors: [
{message: '\'firstname\' is missing in props validation'}
]
}, {
code: [
'class Hello extends React.Component {',
' onSelect = async ({ name }) => {',
' return this.props.foo;',
' }',
' render() {',
' return <Greeting onSelect={this.onSelect} />;',
' }',
'}'
].join('\n'),
parser: 'babel-eslint',
errors: [
{message: '\'foo\' is missing in props validation'}
]
}
]
});

0 comments on commit 5372be3

Please sign in to comment.