Skip to content

Commit d0e4879

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

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/lib/rules/jsx-indent.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ 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
102112
}],
103113

104114
invalid: [{
@@ -162,5 +172,27 @@ ruleTester.run('jsx-indent', rule, {
162172
options: [2],
163173
parserOptions: parserOptions,
164174
errors: [{message: 'Expected indentation of 4 space characters but found 0.'}]
175+
}, {
176+
code: [
177+
'function App() {',
178+
' return (',
179+
' <App />',
180+
' );',
181+
'}'
182+
].join('\n'),
183+
options: [2],
184+
parserOptions: parserOptions,
185+
errors: [{message: 'Expected indentation of 2 space characters but found 4.'}]
186+
}, {
187+
code: [
188+
'function App() {',
189+
' return (',
190+
' <App />',
191+
');',
192+
'}'
193+
].join('\n'),
194+
options: [2],
195+
parserOptions: parserOptions,
196+
errors: [{message: 'Expected indentation of 2 space characters but found 0.'}]
165197
}]
166198
});

0 commit comments

Comments
 (0)