Skip to content

Commit 70b7b80

Browse files
author
Stefan Buck
committed
Add failing test case for jsx-indent
1 parent 82b3aa9 commit 70b7b80

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/lib/rules/jsx-indent.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@ ruleTester.run('jsx-indent', rule, {
9999
].join('\n'),
100100
options: [2],
101101
parserOptions: parserOptions
102+
}, {
103+
code: [
104+
'function App() {',
105+
' return (',
106+
' <App />',
107+
' );',
108+
'}'
109+
].join('\n'),
110+
options: [2],
111+
parserOptions: parserOptions
112+
}, {
113+
code: [
114+
'function App() {',
115+
' return <App>',
116+
' <Foo />',
117+
' </App>;',
118+
'}'
119+
].join('\n'),
120+
options: [2],
121+
parserOptions: parserOptions
102122
}],
103123

104124
invalid: [{
@@ -162,5 +182,27 @@ ruleTester.run('jsx-indent', rule, {
162182
options: [2],
163183
parserOptions: parserOptions,
164184
errors: [{message: 'Expected indentation of 4 space characters but found 0.'}]
185+
}, {
186+
code: [
187+
'function App() {',
188+
' return (',
189+
' <App />',
190+
' );',
191+
'}'
192+
].join('\n'),
193+
options: [2],
194+
parserOptions: parserOptions,
195+
errors: [{message: 'Expected indentation of 2 space characters but found 4.'}]
196+
}, {
197+
code: [
198+
'function App() {',
199+
' return (',
200+
' <App />',
201+
');',
202+
'}'
203+
].join('\n'),
204+
options: [2],
205+
parserOptions: parserOptions,
206+
errors: [{message: 'Expected indentation of 2 space characters but found 0.'}]
165207
}]
166208
});

0 commit comments

Comments
 (0)