Skip to content

Commit 110c272

Browse files
committed
Extend tests to account for this.state in callback
1 parent 2c15742 commit 110c272

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/lib/rules/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ ruleTester.run("no-this-state-props", rule, {
3131
code: "this.setState( ( state, props ) => ( { opened: ! props.open } ) )",
3232
parserOptions: { ecmaVersion: 6 }
3333
},
34+
{
35+
code: "this.setState( ( state, props ) => ( { opened: ! props.open } ), () => ( { state: this.state } ) )",
36+
parserOptions: { ecmaVersion: 6 }
37+
},
3438
{
3539
code: "var yolo = this.state.yolo; this.setState( ( state, props ) => ( { opened: ! props.open } ) )",
3640
parserOptions: { ecmaVersion: 6 }

0 commit comments

Comments
 (0)