I'm trying to set up unit tests for my Angular controllers with Jasmine, but I'm running into problems with ngMock. I've followed the Angular docs and installed angular-mocks through bower, referenced it properly in my index.html
, and added it as a dependency to my app module: angular.module('app', ['ngMock']);
.
The first problem is that adding ngMock
as a dependency stops my entire app from running. I just see a blank page with no errors in the console. Furthermore, whether this dependency is declared or not I keep getting a 'inject' is not defined
error. Seems to me that my Jasmine tests still don't know ngMock
is present.
Every resource I've looked into includes tips for getting this working through Karma, but I'm not using Karma; just a simple Jasmine-node suite of tests.
Aucun commentaire:
Enregistrer un commentaire