title: In React functional Component , test internal functional using jest and enzyme
body: <p>I am using functional Component in React , I need to write unit test case for a method in functional component.</p>
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  function print(){
    console.log('hello');
  }
      
  function Welcome(props){
    return &lt;h1&gt;{props.name}&lt;/h1&gt;;
  }
      
  export default Welcome; 
  
  </code></pre>
  <p>In jest and enzyme :</p>
  <pre class="lang-js prettyprint-override"><code>test (method print , ()=&gt; {
    const container =  shallow(&lt;Welcome /&gt;).instance().print()
  }
  </code></pre>
  <p><code>instance : TypeError Cannot read property of null</code></p>
  <p>I have read functional component don't have an instance in React 16+ . Would someone help in suggesting a way to write unit test cases for methods in functional component.</p>