diff --git a/tests/lib/rules/jsx-indent.js b/tests/lib/rules/jsx-indent.js index d2f7892f96..3b08b9a554 100644 --- a/tests/lib/rules/jsx-indent.js +++ b/tests/lib/rules/jsx-indent.js @@ -99,6 +99,26 @@ ruleTester.run('jsx-indent', rule, { ].join('\n'), options: [2], parserOptions: parserOptions + }, { + code: [ + 'function App() {', + ' return (', + ' ', + ' );', + '}' + ].join('\n'), + options: [2], + parserOptions: parserOptions + }, { + code: [ + 'function App() {', + ' return ', + ' ', + ' ;', + '}' + ].join('\n'), + options: [2], + parserOptions: parserOptions }], invalid: [{ @@ -162,5 +182,27 @@ ruleTester.run('jsx-indent', rule, { options: [2], parserOptions: parserOptions, errors: [{message: 'Expected indentation of 4 space 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.'}] }] });