I have testing a controller method that loops over an asynchronous method. If the method was only called once, I would create a spy and return the pertinent data. However, the async method needs to be called multiple times. For my test, I want to loop over the method twice and resolve the promise with different data for each iteration.
# coffeescript
for i in set
mySvc.myAsyncMethod id
.then (results) ->
# do stuff
Aucun commentaire:
Enregistrer un commentaire