mardi 3 mars 2015

VS, Resharper, Karma, and AngularJS template unit testing with Jasmine

I have an angular js project with a .Net/C# backend. Some of the JS has unit tests, but at least one team member feels like having to jump out to the command line is a high enough barrier where he doesn't want to write unit tests. So I'm trying to get them to run from within VS with Resharper.


The problem is that I have directives in there with html templates. Every resource I found about how to handle that is to use the ng-html2js preprocessor in karma. None of the Resharper documentation tells you directly how to point to a karma.conf file so that that stuff can happen, and I haven't found any resources that suggest there's an alternate way to handle this.


According to the Resharper docs, you can use an html test harness, but I haven't found anything that suggests you can run karma from a test harness. I inherited this project recently, and I'd like to start by trying to address objections by team members rather than telling them to just suck it up and do it.


Can anyone point me in the right direction?


Aucun commentaire:

Enregistrer un commentaire