Skip to content

Commit 8a3f932

Browse files
committed
Add tests to destructuring-assignment
1 parent c0fda3f commit 8a3f932

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/lib/rules/destructuring-assignment.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,29 @@ ruleTester.run('destructuring-assignment', rule, {
142142
' }',
143143
'`'
144144
].join('\n')
145+
}, {
146+
code: `
147+
export default (context: $Context) => ({
148+
foo: context.bar
149+
});
150+
`,
151+
parser: 'babel-eslint'
152+
}, {
153+
code: `
154+
class Foo {
155+
bar(context) {
156+
return context.baz;
157+
}
158+
}
159+
`
160+
}, {
161+
code: `
162+
class Foo {
163+
bar(props) {
164+
return props.baz;
165+
}
166+
}
167+
`
145168
}],
146169

147170
invalid: [{

0 commit comments

Comments
 (0)