diff --git a/tests/lib/rules/jsx-indent.js b/tests/lib/rules/jsx-indent.js
index 75584a32bf..eb796b04cd 100644
--- a/tests/lib/rules/jsx-indent.js
+++ b/tests/lib/rules/jsx-indent.js
@@ -820,6 +820,26 @@ const Component = () => (
);
`,
options: ['tab', {checkAttributes: false}]
+ }, {
+ code: [
+ 'function App() {',
+ ' return (',
+ ' ',
+ ' );',
+ '}'
+ ].join('\n'),
+ options: [2],
+ parserOptions: parserOptions
+ }, {
+ code: [
+ 'function App() {',
+ ' return ',
+ ' ',
+ ' ;',
+ '}'
+ ].join('\n'),
+ options: [2],
+ parserOptions: parserOptions
}],
invalid: [{
@@ -920,6 +940,28 @@ const Component = () => (
].join('\n'),
options: [2],
errors: [{message: 'Expected indentation of 2 space characters but found 4.'}]
+ }, {
+ code: [
+ 'function App() {',
+ ' return (',
+ ' ',
+ ' );',
+ '}'
+ ].join('\n'),
+ output: [
+ 'function App() {',
+ ' return (',
+ ' ',
+ ' ',
+ ' ',
+ ' );',
+ '}'
+ ].join('\n'),
+ options: [2],
+ errors: [{
+ line: 5,
+ message: 'Expected indentation of 4 space characters but found 6.'
+ }]
}, {
code: [
'function App() {',
@@ -1640,5 +1682,27 @@ const Component = () => (
errors: [
{message: 'Expected indentation of 2 tab characters but found 0.'}
]
+ }, {
+ code: [
+ 'function App() {',
+ ' return (',
+ ' ',
+ ' );',
+ '}'
+ ].join('\n'),
+ options: [2],
+ parserOptions: parserOptions,
+ errors: [{message: 'Expected indentation of 2 space characters but found 4.'}]
+ }, {
+ code: [
+ 'function App() {',
+ ' return (',
+ ' ',
+ ');',
+ '}'
+ ].join('\n'),
+ options: [2],
+ parserOptions: parserOptions,
+ errors: [{message: 'Expected indentation of 2 space characters but found 0.'}]
}]
});