Skip to content

Commit

Permalink
Add another invalid test case, using the example from the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Seminck committed Aug 27, 2017
1 parent b92f2c6 commit 36c8aed
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,7 @@ ruleTester.run('prop-types', rule, {
}
`,
parser: 'babel-eslint'
},
{
}, {
code: `
const withOverlayState = <P: {foo: string}>(WrappedComponent: ComponentType<P>): CpmponentType<P> => (
class extends React.Component<P> {
Expand Down Expand Up @@ -3324,6 +3323,24 @@ ruleTester.run('prop-types', rule, {
message: '\'bar\' is missing in props validation'
}],
parser: 'babel-eslint'
}, {
code: `
const withOverlayState = <P: {foo: string}>(WrappedComponent: ComponentType<P>): CpmponentType<P> => (
class extends React.Component<P> {
constructor(props) {
super(props);
this.state = {foo: props.foo, bar: props.bar}
}
render() {
return <div>Hello World</div>
}
}
)
`,
errors: [{
message: '\'bar\' is missing in props validation'
}],
parser: 'babel-eslint'
}
]
});

0 comments on commit 36c8aed

Please sign in to comment.