Skip to content

Commit 3d23496

Browse files
committed
[Tests] destructuring-assignment: add passing test
1 parent 1861255 commit 3d23496

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/lib/rules/destructuring-assignment.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,24 @@ ruleTester.run('destructuring-assignment', rule, {
243243
return null;
244244
};
245245
`
246+
}, {
247+
code: `
248+
class C extends React.Component {
249+
componentDidMount() {
250+
const { forwardRef } = this.props;
246251
252+
this.ref.current.focus();
253+
254+
if (typeof forwardRef === 'function') {
255+
forwardRef(this.ref);
256+
}
257+
}
258+
render() {
259+
return <div />;
260+
}
261+
}
262+
`,
263+
parser: parsers.BABEL_ESLINT
247264
}],
248265

249266
invalid: [{

0 commit comments

Comments
 (0)