Skip to content

Commit

Permalink
[Tests] prop-types: add passing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 20, 2022
1 parent 02bd7da commit 39c79ac
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/lib/rules/prop-types.js
Expand Up @@ -3911,6 +3911,35 @@ ruleTester.run('prop-types', rule, {
});
`,
features: ['types'],
},
{
code: `
import PropTypes from 'prop-types';
import React from 'react';
import { Link } from '..';
const LinkWrapper = ({ primaryLinks }) => (
<>
{primaryLinks.map((x, index) => (
<Link key={index} href={x.link}>
{x.text}
</Link>
))}
</>
);
LinkWrapper.propTypes = {
primaryLinks: PropTypes.arrayOf(
PropTypes.shape({
text: PropTypes.string,
})
),
};
export default LinkWrapper;
`,
features: ['fragment'],
}
)),

Expand Down

0 comments on commit 39c79ac

Please sign in to comment.