Skip to content

Commit 6f2ac7a

Browse files
Kent C. Doddsljharb
authored andcommitted
[Tests] failing test for “don't error if it's not a React Component”
1 parent 716154a commit 6f2ac7a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/lib/rules/no-access-state-in-setstate.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ ruleTester.run('no-access-state-in-setstate', rule, {
101101
};
102102
`,
103103
parserOptions: parserOptions
104+
}, {
105+
code: [
106+
'class StateContainer extends Container {',
107+
' anything() {',
108+
' return this.setState({value: this.state.value + 1})',
109+
' }',
110+
'};'
111+
].join('\n'),
112+
parserOptions: parserOptions
104113
}],
105114

106115
invalid: [{

0 commit comments

Comments
 (0)