I have a React component class with several methods -
var testClass = React.createClass({ testMethod: function(){
I am trying to add unit test using jasmine
import TestClass from './testClass'; describe('test functions', () => { 'use strict'; spyOn(TestClass.prototype, 'testMethod'); it('test calls testMethod', () => { component = TestUtils.renderIntoDocument(<TestClass />); expect(TestClass.prototype.testMethod).toHaveBeenCalled(); });
I can see in the debugger that testMethod does indeed invoke the call, but the jasmine reports are "The expected test method spy testMethod that was called."
Aditi source share