Skip to content

Commit

Permalink
update tests to be async generators
Browse files Browse the repository at this point in the history
  • Loading branch information
pnodet committed Nov 19, 2023
1 parent 1fa1aa9 commit f962068
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/lib/rules/prop-types.js
Expand Up @@ -1571,25 +1571,28 @@ ruleTester.run('prop-types', rule, {
options: [{ skipUndeclared: false }],
},
{
// Async functions can't be components.
// Async generator functions can't be components.
code: `
var Hello = async function(props) {
var Hello = async function* (props) {
yield null;
return <div>Hello {props.name}</div>;
}
`,
},
{
// Async functions can't be components.
// Async generator functions can't be components.
code: `
async function Hello(props) {
async function* Hello(props) {
yield null;
return <div>Hello {props.name}</div>;
}
`,
},
{
// Async functions can't be components.
// Async generator functions can't be components.
code: `
var Hello = async (props) => {
var Hello = async function* (props) {
yield null;
return <div>Hello {props.name}</div>;
}
`,
Expand Down

0 comments on commit f962068

Please sign in to comment.