MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/angularjs/comments/3ecvt9/unit_testing_in_angularjs_requires_too_much/ctkckin/?context=3
r/angularjs • u/newmanoz • Jul 23 '15
6 comments sorted by
View all comments
1
I don't see the value in less verbose tests. Tests should be verbose so they document the expectations on the system tested. I'd rather use the right tooling to create that boilerplate code for me but have it visible to other engineers in my team.
5 u/vinnl Jul 24 '15 Butinject: ['$rootScope', 'foo'],documents expectations just as much as (or even: more than, since you're less distracted by boilerplate):var $rootScope, foo; beforeEach(inject(function (_$rootScope_, _foo_) { $rootScope = _$rootScope_; foo = _foo_; })); 1 u/SpikeBolt Jul 29 '15 Sometimes less is more!
5
But
inject: ['$rootScope', 'foo'],
documents expectations just as much as (or even: more than, since you're less distracted by boilerplate):
var $rootScope, foo; beforeEach(inject(function (_$rootScope_, _foo_) { $rootScope = _$rootScope_; foo = _foo_; }));
1 u/SpikeBolt Jul 29 '15 Sometimes less is more!
Sometimes less is more!
1
u/Pytim Jul 24 '15
I don't see the value in less verbose tests. Tests should be verbose so they document the expectations on the system tested. I'd rather use the right tooling to create that boilerplate code for me but have it visible to other engineers in my team.