File tree Expand file tree Collapse file tree 1 file changed +47
-5
lines changed Expand file tree Collapse file tree 1 file changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,35 @@ eslintTester.addRuleTest('lib/rules/no-literals', {
65
65
] . join ( '\n' ) ,
66
66
args : [ 1 ] ,
67
67
parser : 'babel-eslint'
68
+ } , {
69
+ code : [
70
+ 'class Comp1 extends Component {' ,
71
+ ' render() {' ,
72
+ ' return (' ,
73
+ ' <div>' ,
74
+ ' {\'asdjfl\'}' ,
75
+ ' {\'test\'}' ,
76
+ ' {\'foo\'}' ,
77
+ ' </div>' ,
78
+ ' );' ,
79
+ ' }' ,
80
+ '}'
81
+ ] . join ( '\n' ) ,
82
+ args : [ 1 ] ,
83
+ parser : 'babel-eslint'
84
+ } , {
85
+ code : [
86
+ 'class Comp1 extends Component {' ,
87
+ ' render() {' ,
88
+ ' return (' ,
89
+ ' <div>' ,
90
+ ' </div>' ,
91
+ ' );' ,
92
+ ' }' ,
93
+ '}'
94
+ ] . join ( '\n' ) ,
95
+ args : [ 1 ] ,
96
+ parser : 'babel-eslint'
68
97
}
69
98
] ,
70
99
@@ -147,11 +176,24 @@ eslintTester.addRuleTest('lib/rules/no-literals', {
147
176
] . join ( '\n' ) ,
148
177
args : [ 1 ] ,
149
178
parser : 'babel-eslint' ,
150
- errors : [
151
- { message : 'Missing JSX expression container around literal string' } ,
152
- { message : 'Missing JSX expression container around literal string' } ,
153
- { message : 'Missing JSX expression container around literal string' }
154
- ]
179
+ errors : [ { message : 'Missing JSX expression container around literal string' } ]
180
+ } , {
181
+ code : [
182
+ 'class Comp1 extends Component {' ,
183
+ ' render() {' ,
184
+ ' return (' ,
185
+ ' <div>' ,
186
+ ' {\'asdjfl\'}' ,
187
+ ' test' ,
188
+ ' {\'foo\'}' ,
189
+ ' </div>' ,
190
+ ' );' ,
191
+ ' }' ,
192
+ '}'
193
+ ] . join ( '\n' ) ,
194
+ args : [ 1 ] ,
195
+ parser : 'babel-eslint' ,
196
+ errors : [ { message : 'Missing JSX expression container around literal string' } ]
155
197
}
156
198
]
157
199
} ) ;
You can’t perform that action at this time.
0 commit comments