Skip to content

Commit

Permalink
Adds additional parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karolina-benitez committed Aug 5, 2020
1 parent cad6668 commit dc6665e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/lib/rules/jsx-no-literals.js
Expand Up @@ -44,6 +44,19 @@ ruleTester.run('jsx-no-literals', rule, {

valid: [
{
code: `
class Comp1 extends Component {
render() {
return (
<div>
<button type="button"></button>
</div>
);
}
}
`,
options: [{noStrings: true, allowedStrings: ['button', 'submit']}]
}, {
code: `
class Comp1 extends Component {
render() {
Expand All @@ -57,6 +70,34 @@ ruleTester.run('jsx-no-literals', rule, {
`,
options: [{noStrings: true, allowedStrings: ['button', 'submit']}],
parser: parsers.BABEL_ESLINT
}, {
code: `
class Comp1 extends Component {
render() {
return (
<div>
<button type="button"></button>
</div>
);
}
}
`,
options: [{noStrings: true, allowedStrings: ['button', 'submit']}],
parser: parsers.TYPESCRIPT_ESLINT
}, {
code: `
class Comp1 extends Component {
render() {
return (
<div>
<button type="button"></button>
</div>
);
}
}
`,
options: [{noStrings: true, allowedStrings: ['button', 'submit']}],
parser: parsers['@TYPESCRIPT_ESLINT']
}, {
code: `
class Comp1 extends Component {
Expand Down

0 comments on commit dc6665e

Please sign in to comment.