Skip to content

Commit

Permalink
[Test]: destructuring-assignment add one test
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhoney1 committed Jul 29, 2021
1 parent fd8fba4 commit aa94879
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tests/lib/rules/destructuring-assignment.js
Expand Up @@ -180,9 +180,9 @@ ruleTester.run('destructuring-assignment', rule, {
// https://github.com/yannickcr/eslint-plugin-react/issues/2911
{
code: `
function Foo({context}) {
const d = context.describe()
return <div>{d}</div>
function Foo({ context }) {
const d = context.describe();
return <div>{d}</div>;
}
`,
options: ['always'],
Expand Down Expand Up @@ -412,5 +412,18 @@ ruleTester.run('destructuring-assignment', rule, {
messageId: 'useDestructAssignment',
data: {type: 'props'}
}]
}, {
code: `
function Foo(props, context) {
const d = context.describe();
return <div>{d}</div>;
}
`,
options: ['always'],
parser: parsers.BABEL_ESLINT,
errors: [{
messageId: 'useDestructAssignment',
data: {type: 'context'}
}]
}]
});

0 comments on commit aa94879

Please sign in to comment.