3 ms·
TBH, I'm both amazed by the power and simplicity of Angular && mad at how difficult and unpredictable is to unit test services that use promises and/or depend o
by trumbitta2 12y ago
TBH, I'm both amazed by the power and simplicity of Angular && mad at how difficult and unpredictable is to unit test services that use promises and/or depend on other services.
- Wintamute 12y agoYou can fully mock out those services and pass them into the component under test. Those mocks could return an immediately succeeding (or failing) promise for example. Hey presto, no uncertainty or weird promise handling code in your tests.
- jbergens 12y agoI think promises are hard to test regardless of framework. As a side note most Angular examples seems to do more functional testing than unit testing since they don't mock many other services.