Skip to content

Commit a13593d

Browse files
committed
[Tests] jsx-indent: add passing test case
Closes #500
1 parent d9ccfe4 commit a13593d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/lib/rules/jsx-indent.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,5 +2738,38 @@ const Component = () => (
27382738
},
27392739
],
27402740
},
2741+
{
2742+
code: `
2743+
const StatelessComponent = () => {
2744+
if (new Date() % 2) {
2745+
return (
2746+
<div>Hello</div>
2747+
);
2748+
}
2749+
return null;
2750+
};
2751+
`,
2752+
output: `
2753+
const StatelessComponent = () => {
2754+
if (new Date() % 2) {
2755+
return (
2756+
<div>Hello</div>
2757+
);
2758+
}
2759+
return null;
2760+
};
2761+
`,
2762+
errors: [
2763+
{
2764+
messageId: 'wrongIndent',
2765+
data: {
2766+
needed: 18,
2767+
gotten: 8,
2768+
type: 'space',
2769+
characters: 'characters',
2770+
},
2771+
},
2772+
],
2773+
},
27412774
]),
27422775
});

0 commit comments

Comments
 (0)