Skip to content

Commit

Permalink
Add test for jsx-eslint#1908
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzherdev committed Sep 22, 2018
1 parent 8add5de commit 88921bd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/lib/rules/default-props-match-prop-types.js
Expand Up @@ -1568,6 +1568,27 @@ ruleTester.run('default-props-match-prop-types', rule, {
message: 'defaultProp "foo" defined for isRequired propType.'
}
]
},
{
code: `
class SomeComponent extends React.Component {
render() {
return <div />;
}
}
SomeComponent.propTypes = {
"firstProperty": PropTypes.string.isRequired,
};
SomeComponent.defaultProps = {
"firstProperty": () => undefined
};
`,
errors: [
{
message: 'defaultProp "firstProperty" defined for isRequired propType.'
}
]
}
]
});

0 comments on commit 88921bd

Please sign in to comment.