Skip to content

Commit

Permalink
[Tests] no-typos: add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 3, 2018
1 parent d61a096 commit d9c36bf
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/lib/rules/no-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ruleTester.run('no-typos', rule, {
const contextTypes = "CONTEXTTYPES"
const childContextTypes = "CHILDCONTEXTTYPES"
const defautProps = "DEFAULTPROPS"
class First extends React.Component {}
First[propTypes] = {};
First[contextTypes] = {};
Expand Down Expand Up @@ -338,6 +338,29 @@ ruleTester.run('no-typos', rule, {
`,
parser: 'babel-eslint',
parserOptions: parserOptions
}, {
// ensure that an absent arg to PropTypes.shape does not crash
code: `class Component extends React.Component {};
Component.propTypes = {
a: PropTypes.shape(),
};
Component.contextTypes = {
a: PropTypes.shape(),
};
`,
parserOptions: parserOptions
}, {
// ensure that an absent arg to PropTypes.shape does not crash
code: `class Component extends React.Component {};
Component.propTypes = {
a: PropTypes.shape(),
};
Component.contextTypes = {
a: PropTypes.shape(),
};
`,
parser: 'babel-eslint',
parserOptions: parserOptions
}, {
code: `
const fn = (err, res) => {
Expand Down

0 comments on commit d9c36bf

Please sign in to comment.