Skip to content

Commit 5515130

Browse files
committed
Add more mixed tests
1 parent 408e1b1 commit 5515130

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/lib/rules/jsx-curly-spacing.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,43 @@ ruleTester.run('jsx-curly-spacing', rule, {
475475
}, {
476476
code: '<App foo={ bar }>{bar}</App>',
477477
options: [{attributes: {when: 'always'}}]
478+
}, {
479+
code: '<App foo={ bar }>{bar}</App>',
480+
options: [{attributes: {when: 'always'}}]
481+
}, {
482+
code: [
483+
'<App foo={ 42 } { ...bar } baz={{ 4: 2 }}>',
484+
'{foo} {{ bar: baz }}',
485+
'</App>'
486+
].join('\n'),
487+
options: [{
488+
when: 'never',
489+
attributes: {when: 'always', spacing: {objectLiterals: 'never'}},
490+
children: true
491+
}]
492+
}, {
493+
code: [
494+
'<App foo={42} {...bar} baz={ { 4: 2 } }>',
495+
'{foo} { { bar: baz } }',
496+
'</App>'
497+
].join('\n'),
498+
options: [{
499+
when: 'never',
500+
spacing: {objectLiterals: 'always'},
501+
attributes: true,
502+
children: {when: 'never'}
503+
}]
504+
}, {
505+
code: [
506+
'<App foo={42} {...bar} baz={ { 4: 2 } }>',
507+
'{foo} { { bar: baz } }',
508+
'</App>'
509+
].join('\n'),
510+
options: [{
511+
spacing: {objectLiterals: 'always'},
512+
attributes: {when: 'never', spacing: {objectLiterals: 'always'}},
513+
children: {when: 'never'}
514+
}]
478515
}],
479516

480517
invalid: [{

0 commit comments

Comments
 (0)