From d0e4879359cbc0acca6d50bc0285d9c3540b14a6 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 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/lib/rules/jsx-indent.js b/tests/lib/rules/jsx-indent.js index d2f7892f96..6eba8d83ae 100644 --- a/tests/lib/rules/jsx-indent.js +++ b/tests/lib/rules/jsx-indent.js @@ -99,6 +99,16 @@ ruleTester.run('jsx-indent', rule, { ].join('\n'), options: [2], parserOptions: parserOptions + }, { + code: [ + 'function App() {', + ' return (', + ' ', + ' );', + '}' + ].join('\n'), + options: [2], + parserOptions: parserOptions }], invalid: [{ @@ -162,5 +172,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.'}] }] });