title: Check State value for functional components in Jest
body: <p>My component has a <code>state</code>(speciality) and how can i check this state value in my test case?     </p>
  
  <p>component.jsx</p>
  
  <pre><code>      export function SearchProviders({ changeRoute }) {
               const [speciality, setspeciality] = useState("Hospital");
               // blah blah blah
        }
  </code></pre>
  
  <p>Test.jsx</p>
  
  <pre><code>const renderedModule = shallow(&lt;SearchProviders /&gt;);
  const speciality = renderedModule.find('#speciality');
  speciality.simulate('change');
  console.log(renderedModule.state('speciality'));
  </code></pre>
  
  <p>I tried like this but its giving me error saying <code>state() can only be called on class components</code></p>