Given the function with callback as follows:
myfunction('some value', function(){
//do something...
})
How can I cover and test it using Jasmine
? It never enters in the flow inside the function(){...
callback.
Thanks
Given the function with callback as follows:
myfunction('some value', function(){
//do something...
})
How can I cover and test it using Jasmine
? It never enters in the flow inside the function(){...
callback.
Thanks
In cases like this, there are (at least) two unit tests that you need to create:
myFunction
So it might look something like this:
Note that I say at least 2 tests because you will probably need to test different paths through each of these functions.
Also note that this requires you to be able to access the callback in your tests, so it needs to be exposed from the module you are creating.