Skip to content

Commit a0d2227

Browse files
committed
Rewrite jsx-no-undef tests with template literals
1 parent eb8e3cb commit a0d2227

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

tests/lib/rules/jsx-no-undef.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,29 @@ ruleTester.run('jsx-no-undef', rule, {
4242
}, {
4343
code: '/*eslint no-undef:1*/ var React, app; React.render(<app.foo.Bar />);'
4444
}, {
45-
code: [
46-
'/*eslint no-undef:1*/',
47-
'var React;',
48-
'class Hello extends React.Component {',
49-
' render() {',
50-
' return <this.props.tag />',
51-
' }',
52-
'}'
53-
].join('\n')
45+
code: `
46+
/*eslint no-undef:1*/
47+
var React;
48+
class Hello extends React.Component {
49+
render() {
50+
return <this.props.tag />
51+
}
52+
}
53+
`
5454
}, {
5555
code: 'var React; React.render(<Text />);',
5656
globals: {
5757
Text: true
5858
}
5959
}, {
60-
code: [
61-
'import Text from "cool-module";',
62-
'const TextWrapper = function (props) {',
63-
' return (',
64-
' <Text />',
65-
' );',
66-
'};'
67-
].join('\n'),
60+
code: `
61+
import Text from "cool-module";
62+
const TextWrapper = function (props) {
63+
return (
64+
<Text />
65+
);
66+
};
67+
`,
6868
parserOptions: Object.assign({sourceType: 'module'}, parserOptions),
6969
options: [{
7070
allowGlobals: false
@@ -97,14 +97,14 @@ ruleTester.run('jsx-no-undef', rule, {
9797
message: '\'appp\' is not defined.'
9898
}]
9999
}, {
100-
code: [
101-
'const TextWrapper = function (props) {',
102-
' return (',
103-
' <Text />',
104-
' );',
105-
'};',
106-
'export default TextWrapper;'
107-
].join('\n'),
100+
code: `
101+
const TextWrapper = function (props) {
102+
return (
103+
<Text />
104+
);
105+
};
106+
export default TextWrapper;
107+
`,
108108
parserOptions: Object.assign({sourceType: 'module'}, parserOptions),
109109
errors: [{
110110
message: '\'Text\' is not defined.'

0 commit comments

Comments
 (0)