Skip to content

Commit 61981c7

Browse files
committed
chore: add test cases
1 parent 86d7ac8 commit 61981c7

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

tests/lib/rules/no-render-return-undefined.js

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @fileoverview Tests for no-danger
3-
* @author Scott Andrews
3+
* @author Akul Srivastava
44
*/
55

66
'use strict';
@@ -118,6 +118,13 @@ ruleTester.run('no-render-return-undefined', rule, {
118118
}
119119
`,
120120
},
121+
{
122+
code: `
123+
function App() {
124+
return [<div/>, <span/>];
125+
}
126+
`,
127+
},
121128
]),
122129
invalid: parsers.all([
123130
{
@@ -235,5 +242,49 @@ ruleTester.run('no-render-return-undefined', rule, {
235242
`,
236243
errors: [{ messageId: 'returnsUndefined' }],
237244
},
245+
{
246+
code: `
247+
function App() {
248+
return
249+
<div />
250+
}
251+
`,
252+
errors: [{ messageId: 'returnsUndefined' }],
253+
},
254+
{
255+
code: `
256+
function App() {
257+
return
258+
[]
259+
}
260+
`,
261+
errors: [{ messageId: 'returnsUndefined' }],
262+
},
263+
{
264+
code: `
265+
function App() {
266+
return
267+
123
268+
}
269+
`,
270+
errors: [{ messageId: 'returnsUndefined' }],
271+
},
272+
{
273+
code: `
274+
function App() {
275+
return
276+
"abc"
277+
}
278+
`,
279+
errors: [{ messageId: 'returnsUndefined' }],
280+
},
281+
{
282+
code: `
283+
function App() {
284+
return; <div />;
285+
}
286+
`,
287+
errors: [{ messageId: 'returnsUndefined' }],
288+
},
238289
]),
239290
});

0 commit comments

Comments
 (0)