title: How to test arrow function in React ES6 class
body: <p>I used arrow function inside of my React component to avoid binding this context, for example my component look like this;</p>
  
  <pre><code>class Comp extends Component {
     _fn1 = () =&gt; {}
     _fn2 = () =&gt; {}
     render() {
        return (&lt;div&gt;&lt;/div&gt;);
     }
  }
  </code></pre>
  
  <p>How do I test <code>_fn1</code> and <code>_fn2</code> function in my test cases? Because these kind of function did not associated with React component itself, so when I do</p>
  
  <pre><code> fnStub = sandbox.stub(Comp.prototype, "_fn1");
  </code></pre>
  
  <p>it is not going work, since <code>_fn</code> did not bind with <code>Comp.prototype</code>. Thus, how can I test those functions in React if I want to create function with arrow syntax? Thanks!</p>