Skip to content

Commit

Permalink
merged one of the previous tests and added 2 new tests for the defaul…
Browse files Browse the repository at this point in the history
…t parser
  • Loading branch information
lfades committed Jan 21, 2018
1 parent 8360ffa commit 942a92c
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions tests/lib/rules/no-typos.js
Expand Up @@ -369,6 +369,16 @@ ruleTester.run('no-typos', rule, {
};
`,
parser: 'babel-eslint'
}, {
code: `class Component extends React.Component {};
Component.propTypes = {
b: string.isRequired,
c: PropTypes.shape({
d: number.isRequired,
}).isRequired
}
`,
parserOptions: parserOptions
}, {
code: `class Component extends React.Component {};
Component.propTypes = {
Expand Down Expand Up @@ -809,25 +819,32 @@ ruleTester.run('no-typos', rule, {
}, {
code: `class Component extends React.Component {};
Component.propTypes = {
b: string.isrequired
a: string.isrequired,
b: shape({
c: number
}).isrequired
}
`,
parser: 'babel-eslint',
parserOptions: parserOptions,
errors: [{
message: 'Typo in declared prop type: isrequired'
}, {
message: 'Typo in prop type chain qualifier: isrequired'
}]
}, {
code: `class Component extends React.Component {};
Component.propTypes = {
c: shape({
d: number,
a: string.isrequired,
b: shape({
c: number
}).isrequired
}
}
`,
parser: 'babel-eslint',
parserOptions: parserOptions,
errors: [{
message: 'Typo in declared prop type: isrequired'
}, {
message: 'Typo in prop type chain qualifier: isrequired'
}]
}]
Expand Down

0 comments on commit 942a92c

Please sign in to comment.