Skip to content

Commit

Permalink
Add failing test case for jsx-indent
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbuck committed Jun 4, 2016
1 parent 82b3aa9 commit 70b7b80
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/lib/rules/jsx-indent.js
Expand Up @@ -99,6 +99,26 @@ ruleTester.run('jsx-indent', rule, {
].join('\n'),
options: [2],
parserOptions: parserOptions
}, {
code: [
'function App() {',
' return (',
' <App />',
' );',
'}'
].join('\n'),
options: [2],
parserOptions: parserOptions
}, {
code: [
'function App() {',
' return <App>',
' <Foo />',
' </App>;',
'}'
].join('\n'),
options: [2],
parserOptions: parserOptions
}],

invalid: [{
Expand Down Expand Up @@ -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 (',
' <App />',
' );',
'}'
].join('\n'),
options: [2],
parserOptions: parserOptions,
errors: [{message: 'Expected indentation of 2 space characters but found 4.'}]
}, {
code: [
'function App() {',
' return (',
' <App />',
');',
'}'
].join('\n'),
options: [2],
parserOptions: parserOptions,
errors: [{message: 'Expected indentation of 2 space characters but found 0.'}]
}]
});

0 comments on commit 70b7b80

Please sign in to comment.