Skip to content

Commit

Permalink
[Tests] jsx-curly-brace-presence, jsx-no-comment-textnodes: add p…
Browse files Browse the repository at this point in the history
…assing tests

Closes #2716.
  • Loading branch information
ljharb committed Jul 18, 2020
1 parent e3e767b commit bb2b8db
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
15 changes: 15 additions & 0 deletions tests/lib/rules/jsx-curly-brace-presence.js
Expand Up @@ -400,6 +400,21 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
</App>
`,
options: [{children: 'always'}]
},
{
code: `
const Component2 = () => {
return <span>/*</span>;
};
`
},
{
code: `
const Component2 = () => {
return <span>/*</span>;
};
`,
options: [{props: 'never', children: 'never'}]
}
],

Expand Down
18 changes: 13 additions & 5 deletions tests/lib/rules/jsx-no-comment-textnodes.js
Expand Up @@ -378,16 +378,24 @@ ruleTester.run('jsx-no-comment-textnodes', rule, {
`,
parser: parsers.BABEL_ESLINT,
errors: [{message: 'Comments inside children section of tag should be placed inside braces'}]
},
{
code: `
const Component2 = () => {
return <span>/*</span>;
};
`,
errors: [{message: 'Comments inside children section of tag should be placed inside braces'}]
}
].concat(parsers.TS([
{
code: `
class Comp1 extends Component {
render() {
return (<div>// invalid</div>);
class Comp1 extends Component {
render() {
return (<div>// invalid</div>);
}
}
}
`,
`,
parser: parsers['@TYPESCRIPT_ESLINT'],
errors: [{message: 'Comments inside children section of tag should be placed inside braces'}]
}, {
Expand Down

0 comments on commit bb2b8db

Please sign in to comment.