Reputation: 2057
I am new in jasmine testing and I have searched the test case example for requestAnimationFrame in jasmine document, but I couldn't find it.
I found this plugin to create mock requestAnimationFrame, but I need to use jasmine inbuilt option to test requestAnimationFrame.
Is there any option to test the requestAnimationFrame with jasmine using inbuilt functionalities?
Upvotes: 4
Views: 2181
Reputation: 16450
Use setTimeout()
and done()
:
it("Spec with requestAnimationFrame", (done) => {
window.requestAnimationFrame(() => {
// Do something testable here
});
setTimeout(function() {
// Verify testable values here
done();
}, 200);
});
Upvotes: 2