From 70b7b80b3a571032242831d1c136bee39e22cc7f Mon Sep 17 00:00:00 2001 From: Stefan Buck Date: Fri, 3 Jun 2016 15:32:29 +0200 Subject: [PATCH] Add failing test case for jsx-indent --- tests/lib/rules/jsx-indent.js | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) 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.'}] }] });