Skip to content

Commit d9c36bf

Browse files
committed
[Tests] no-typos: add regression test
1 parent d61a096 commit d9c36bf

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

tests/lib/rules/no-typos.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ ruleTester.run('no-typos', rule, {
174174
const contextTypes = "CONTEXTTYPES"
175175
const childContextTypes = "CHILDCONTEXTTYPES"
176176
const defautProps = "DEFAULTPROPS"
177-
177+
178178
class First extends React.Component {}
179179
First[propTypes] = {};
180180
First[contextTypes] = {};
@@ -338,6 +338,29 @@ ruleTester.run('no-typos', rule, {
338338
`,
339339
parser: 'babel-eslint',
340340
parserOptions: parserOptions
341+
}, {
342+
// ensure that an absent arg to PropTypes.shape does not crash
343+
code: `class Component extends React.Component {};
344+
Component.propTypes = {
345+
a: PropTypes.shape(),
346+
};
347+
Component.contextTypes = {
348+
a: PropTypes.shape(),
349+
};
350+
`,
351+
parserOptions: parserOptions
352+
}, {
353+
// ensure that an absent arg to PropTypes.shape does not crash
354+
code: `class Component extends React.Component {};
355+
Component.propTypes = {
356+
a: PropTypes.shape(),
357+
};
358+
Component.contextTypes = {
359+
a: PropTypes.shape(),
360+
};
361+
`,
362+
parser: 'babel-eslint',
363+
parserOptions: parserOptions
341364
}, {
342365
code: `
343366
const fn = (err, res) => {

0 commit comments

Comments
 (0)