Skip to content

Commit ef4db36

Browse files
committed
update tests to be async generators
1 parent 2d9e80a commit ef4db36

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/lib/rules/prop-types.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,25 +1571,28 @@ ruleTester.run('prop-types', rule, {
15711571
options: [{ skipUndeclared: false }],
15721572
},
15731573
{
1574-
// Async functions can't be components.
1574+
// Async generator functions can't be components.
15751575
code: `
1576-
var Hello = async function(props) {
1576+
var Hello = async function* (props) {
1577+
yield null;
15771578
return <div>Hello {props.name}</div>;
15781579
}
15791580
`,
15801581
},
15811582
{
1582-
// Async functions can't be components.
1583+
// Async generator functions can't be components.
15831584
code: `
1584-
async function Hello(props) {
1585+
async function* Hello(props) {
1586+
yield null;
15851587
return <div>Hello {props.name}</div>;
15861588
}
15871589
`,
15881590
},
15891591
{
1590-
// Async functions can't be components.
1592+
// Async generator functions can't be components.
15911593
code: `
1592-
var Hello = async (props) => {
1594+
var Hello = async function* (props) {
1595+
yield null;
15931596
return <div>Hello {props.name}</div>;
15941597
}
15951598
`,

0 commit comments

Comments
 (0)