From 536bc35643eacfacbeb2391c8ee49903b97954dc Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 16 Jan 2019 23:04:53 -0800 Subject: [PATCH] [Tests] `prop-types`: add case from #2134 Closes #2134 --- tests/lib/rules/prop-types.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/lib/rules/prop-types.js b/tests/lib/rules/prop-types.js index c8fa145216..0babd91930 100644 --- a/tests/lib/rules/prop-types.js +++ b/tests/lib/rules/prop-types.js @@ -4414,6 +4414,34 @@ ruleTester.run('prop-types', rule, { errors: [{ message: '\'a\' is missing in props validation' }] + }, + { + code: ` + class Foo extends React.Component { + contructor(props) { + super(props); + this.initialValues = { + test: '', + }; + } + + render = () => { + return ( + + {formikProps => ( + + )} + + ); + } + } + `, + parser: 'babel-eslint', + errors: [{ + message: '\'initialValues\' is missing in props validation' + }] } ] });