diff --git a/tests/lib/rules/destructuring-assignment.js b/tests/lib/rules/destructuring-assignment.js
index bf6eb46fa9..185c788e7c 100644
--- a/tests/lib/rules/destructuring-assignment.js
+++ b/tests/lib/rules/destructuring-assignment.js
@@ -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
{d}
+ function Foo({ context }) {
+ const d = context.describe();
+ return {d}
;
}
`,
options: ['always'],
@@ -412,5 +412,18 @@ ruleTester.run('destructuring-assignment', rule, {
messageId: 'useDestructAssignment',
data: {type: 'props'}
}]
+ }, {
+ code: `
+ function Foo(props, context) {
+ const d = context.describe();
+ return {d}
;
+ }
+ `,
+ options: ['always'],
+ parser: parsers.BABEL_ESLINT,
+ errors: [{
+ messageId: 'useDestructAssignment',
+ data: {type: 'context'}
+ }]
}]
});