Skip to content

Commit

Permalink
[Tests] jsx-one-expression-per-line: add passing tests.
Browse files Browse the repository at this point in the history
Closes #1835.
  • Loading branch information
TaLeaMonet authored and ljharb committed Sep 18, 2020
1 parent 74c4eed commit 08eda7a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -21,7 +21,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
* [`jsx-handler-names`]: false positive when handler name begins with number ([#1689][] @jsphstls)
* [`prop-types`]: Detect JSX returned by sequential expression ([#2801][] @mikol)

### Changed
* [Tests] [`jsx-one-expression-per-line`]: add passing tests ([#2799][] @TaLeaMonet)

[#2801]: https://github.com/yannickcr/eslint-plugin-react/pull/2801
[#2799]: https://github.com/yannickcr/eslint-plugin-react/pull/2799
[#2796]: https://github.com/yannickcr/eslint-plugin-react/pull/2796
[#2791]: https://github.com/yannickcr/eslint-plugin-react/pull/2791
[#2789]: https://github.com/yannickcr/eslint-plugin-react/pull/2789
Expand Down
23 changes: 23 additions & 0 deletions tests/lib/rules/jsx-one-expression-per-line.js
Expand Up @@ -1029,5 +1029,28 @@ ruleTester.run('jsx-one-expression-per-line', rule, {
errors: [{message: '`Foo` must be placed on a new line'}],
parser: parsers.BABEL_ESLINT,
parserOptions
}, {
code: [
'<div>',
'<MyComponent>a</MyComponent>',
'<MyOther>{a}</MyOther>',
'</div>'
].join('\n'),
output: [
'<div>',
'<MyComponent>',
'a',
'</MyComponent>',
'<MyOther>',
'{a}',
'</MyOther>',
'</div>'
].join('\n'),
errors: [
{message: '`a` must be placed on a new line'},
{message: '`{a}` must be placed on a new line'}
],
parser: parsers.BABEL_ESLINT,
parserOptions
}]
});

0 comments on commit 08eda7a

Please sign in to comment.