Skip to content

Commit

Permalink
Update tests to avoid syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Jul 20, 2024
1 parent 890427c commit ad8d26e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/lib/rules/forward-ref-uses-ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,20 @@ const tests = {
{
code: `
import { forwardRef } from 'react'
forwardRef(function (props) {
const Component = forwardRef(function (props) {
return null;
});
`,
errors: [
{
message: 'forwardRef is used with this component but no ref parameter is set',
message:
'forwardRef is used with this component but no ref parameter is set',
suggestions: [
{
messageId: 'addRefParameter',
output: `
import { forwardRef } from 'react'
forwardRef(function (props, ref) {
const Component = forwardRef(function (props, ref) {
return null;
});
`,
Expand All @@ -219,7 +220,7 @@ const tests = {
messageId: 'removeForwardRef',
output: `
import { forwardRef } from 'react'
function (props) {
const Component = function (props) {
return null;
};
`,
Expand Down

0 comments on commit ad8d26e

Please sign in to comment.