News for hackers. Stuff that matters.
Re:Angular 2 Core by trumbitta2 on Saturday October 25, 2014 @09:38AM (#8508169)
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.
Re:Angular 2 Core by Wintamute on Sunday October 26, 2014 @09:21AM (#8510939)
You 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.
Re:Angular 2 Core by jbergens on Sunday October 26, 2014 @06:41PM (#8512794)
I 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.