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 authored and ljharb committed Jun 3, 2016
1 parent e747459 commit 26eadf5
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions tests/lib/rules/jsx-indent.js
Expand Up @@ -820,6 +820,26 @@ const Component = () => (
);
`,
options: ['tab', {checkAttributes: false}]
}, {
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 @@ -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 (<App>',
' <Foo />',
' </App>);',
'}'
].join('\n'),
output: [
'function App() {',
' return (',
' <App>',
' <Foo />',
' </App>',
' );',
'}'
].join('\n'),
options: [2],
errors: [{
line: 5,
message: 'Expected indentation of 4 space characters but found 6.'
}]
}, {
code: [
'function App() {',
Expand Down Expand Up @@ -1640,5 +1682,27 @@ const Component = () => (
errors: [
{message: 'Expected indentation of 2 tab 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 26eadf5

Please sign in to comment.