testing

Evaluating function return values with Jasmine

I’ve been using jasmine at work as a javascript test framework to cover front-end code with all sorts of tests. Recently, on one particular spec, I needed to capture the values returned by a spied upon fonction, without completely interrupting the code execution. As capturing returned values from a spy before continuing code execution is something I couldn’t find in the jasmine framework, I wrote a small integration test that required to use spyOn().andCallFake(), instead of spyOn().andCallThrough(). Here’s my attempt at an implementation.

read more

Categories