我想开始为我的angularjs项目进行单元测试。这远非直截了当,我觉得这很困难。我正在使用Karma和Jasmine。为了测试我的路线和应用程序依赖关系,我很好。但是,你如何测试这样的指令?单元测试angularjs指令
angular.module('person.directives', []).
directive("person", function() {
return {
restrict: "E",
templateUrl: "person/views/person.html",
replace: true,
scope: {
myPerson: '='
},
link: function (scope, element, attrs) {
}
}
});
如何我会测试实例模板被发现?
有在测试指令的视频,可以帮助 - http://www.youtube.com/watch?v=rB5b67Cg6bc – Neil