Skip to content

Commit

Permalink
[Tests] jsx-indent: Added test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
toshi-toma committed Jan 14, 2020
1 parent a92ed91 commit 0076cb0
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tests/lib/rules/jsx-indent.js
Expand Up @@ -955,6 +955,27 @@ const Component = () => (
}
`,
options: [2, {indentLogicalExpressions: true}]
}, {
code: [
'<App>',
' text',
'</App>'
].join('\n')
}, {
code: [
'<App>',
' text',
' text',
' text',
'</App>'
].join('\n')
}, {
code: [
'<App>',
'\ttext',
'</App>'
].join('\n'),
options: ['tab']
}],

invalid: [{
Expand Down Expand Up @@ -1882,5 +1903,44 @@ const Component = () => (
errors: [
{message: 'Expected indentation of 8 space characters but found 4.'}
]
}, {
code: [
'<div>',
'text',
'</div>'
].join('\n'),
errors: [
{message: 'Expected indentation of 4 space characters but found 0.'}
]
}, {
code: [
'<div>',
' text',
'text',
'</div>'
].join('\n'),
errors: [
{message: 'Expected indentation of 4 space characters but found 2,0.'}
]
}, {
code: [
'<div>',
'\t text',
' \t text',
'</div>'
].join('\n'),
errors: [
{message: 'Expected indentation of 4 space characters but found 0,2.'}
]
}, {
code: [
'<div>',
'\t\ttext',
'</div>'
].join('\n'),
options: ['tab'],
errors: [
{message: 'Expected indentation of 1 tab character but found 2.'}
]
}]
});

0 comments on commit 0076cb0

Please sign in to comment.