Skip to content

Commit 78a4a9e

Browse files
author
Yannick Croissant
committed
Add more ES7 bind operator tests for jsx-handler-names
1 parent ae5a43b commit 78a4a9e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/lib/rules/jsx-handler-names.js

+16
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ ruleTester.run('jsx-handler-names', rule, {
8383
'<TestComponent onChange={props::handleChange} />'
8484
].join('\n'),
8585
parser: 'babel-eslint'
86+
}, {
87+
code: [
88+
'<TestComponent onChange={::props.onChange} />'
89+
].join('\n'),
90+
parser: 'babel-eslint'
91+
}, {
92+
code: [
93+
'<TestComponent onChange={props.foo::handleChange} />'
94+
].join('\n'),
95+
parser: 'babel-eslint'
8696
}],
8797

8898
invalid: [{
@@ -109,5 +119,11 @@ ruleTester.run('jsx-handler-names', rule, {
109119
].join('\n'),
110120
parser: 'babel-eslint',
111121
errors: [{message: 'Handler function for onChange prop key must begin with \'handle\''}]
122+
}, {
123+
code: [
124+
'<TestComponent onChange={props.foo::onChange} />'
125+
].join('\n'),
126+
parser: 'babel-eslint',
127+
errors: [{message: 'Handler function for onChange prop key must begin with \'handle\''}]
112128
}]
113129
});

0 commit comments

Comments
 (0)