Skip to content

Commit daf7726

Browse files
committed
Add class based component test.
1 parent 83bd290 commit daf7726

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/lib/rules/forbid-component-props.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,20 @@ ruleTester.run('forbid-component-props', rule, {
8686
'var First = React.createClass({',
8787
' propTypes: externalPropTypes,',
8888
' render: function() {',
89-
' return <this.Foo className="bar" />;',
89+
' return <this.Foo bar="baz" />;',
9090
' }',
9191
'});'
9292
].join('\n'),
93-
options: [{forbid: ['style', 'foo']}],
93+
parserOptions: parserOptions
94+
}, {
95+
code: [
96+
'class First extends React.createClass {',
97+
' render() {',
98+
' return <this.foo className="bar" />;',
99+
' }',
100+
'}'
101+
].join('\n'),
102+
options: [{forbid: ['style']}],
94103
parserOptions: parserOptions
95104
}],
96105

0 commit comments

Comments
 (0)