angular

Overview

I had a some time this weekend and was exploring the ways we could improve our javascript unit tests. The one thing I do not really like about angular unit testing is too much boilerplate code. Probably you all know something like this:

1
2
3
4
5
6
7
8
9
10
11
beforeEach(module('blabla'));
beforeEach( inject ( function ($controller, $rootScope, _$q_) {
$q = _$q_;
$scope = $rootScope.$new();
controller = $controller('createUserController', {
$scope: $scope,
TeamsService: TeamsService,
CountriesService: CountriesService,
Toggles: Toggles
});
}));

It’s not very exciting. Sure, you could create some level of abstraction above it and reuse it in all your tests, but it’s not so trivial and probably need significant amount of time to implement.

And here is a little utility library ng-describe to help.

There was a screening of some videos from ng-conf which took place about 10 days ago somewhere in US :) We have - with Mojzis - prepaired few words to kick off a discussion after the screening and I have added some extra code related to one of those videos.

To share some thoughts about ng-conf and life in general we organized a little get-together at the Krakovska premises. With the managerial help of Honza and PR skills of Bob, we had quite a few colleagues attending, some also remotely (guys, did we at least show you all the food and drinks ?).