mercredi 28 janvier 2015

Angular integration testing

I'm not having much luck googling this, so, here goes...


I've got an Angular application, which talks to an node (express) API, and we've got no integration testing - making it too easy to 'break' the integration between the two parts of the system, having to test by hand is obviously far from ideal.


I wanted to avoid Protractor (we've got a really rich UI in the angular app, and it's proving difficult get protractor to play nice). As it stands, we have a fairly standard structure for an angular app - controllers that feed data to views (using 'Controller as'). The controllers interact with services, services do all the $http calls.


Ideally, I'd test from the controllers 'down'. Is there anything out there to support this kind of approach?


The most promising approach appears to be stopping angular-mocks from injecting it's own mocked $http/$httpbackend. But I'm keen to hear your thoughts on this and alternative approaches.


Thanks, Dave


Aucun commentaire:

Enregistrer un commentaire