Reply To: Achieving “functional core, imperative shell” using generators and promises


I’m not sure what IO testing you have in mind. This code fragment doesn’t contain any IO, and the fact that it uses generator has nothing to do with it – it just doesn’t.

To test “no-yield” version of this code you would pass `$http` stub that returns `$fakeResponse` you want to test your code with, and here you need to pass fake `$http` (that yields some `Promise` dummy) and then send `$fakeResponse` to generator – that’s the only difference.