lundi 21 décembre 2015

What tool to use for testing Angular views? Services, Factories, and Controllers are all being tested with Jasmine and Karma

I am new to the world of unit testing. So far I have been able to test all of my factories, services, and controllers using Karma and Jasmine. I have been spying on a lot of the restangular calls and have been returning mock data. My question now is, what are the best practices for testing views. I saw some examples of people using fixtures and loading the html code into the regular Jasmine specs. I have also seen people using a tool called Protractor (which I am not very familiar with) and testing their application from a web server. If I do indeed have to use Protractor, is it advantageous for me to reference the views from the source files or to get a running instance of my app up? Can I simply load the view and controller and test that way or do I have to have a whole instance of my app? The goal here is to see if my view can properly load some mock data into a list and when I click a button, that list changes.

Aucun commentaire:

Enregistrer un commentaire