I am trying to test my implementation of debounce function and it requires mocking internal clock in jasmine. I used similar code as mentioned here: https://bambielli.com/til/2016-03-02-jasmine-mock-clock/
But when I call jasmine.clock().install(); in beforeEach function, I get: TypeError: Cannot assign to read only property 'setTimeout' of object '[object Object]'.
Guys,
I am trying to test my implementation of debounce function and it requires mocking internal clock in jasmine. I used similar code as mentioned here: https://bambielli.com/til/2016-03-02-jasmine-mock-clock/ But when I call
jasmine.clock().install();
inbeforeEach
function, I get:TypeError: Cannot assign to read only property 'setTimeout' of object '[object Object]'
.Can you guys help me?