Я пытаюсь протестировать простой контроллер в angularjs, , но файлы, которые не загружаются в браузер. Мои файлы следующие.Файлы не загружены в Karma (Angularjs)
files: [ 'js/test.js','js/app.js','js/angular.min.js']
Если я дал неверный путь к файлу, Карма не дает мне никаких ошибок/предупреждений.
Пример:
files: [ 'js/test_wrong_path.js','js/app_wrong_path.js','js/angular.min.js']
когда я делаю старт карма, только браузер становится запущен. ничего не происходит.
app.js
1. angular.module('app', [])
1. .controller('PasswordController', function PasswordController($scope) {
1. $scope.password = '';
1. $scope.grade = function() {
1. var size = $scope.password.length;
1. if (size > 8) {
1. $scope.strength = 'strong';
3. } else if (size > 3) {
3. $scope.strength = 'medium';
3. } else {
3. $scope.strength = 'weak';
3. }
3. };
1. });
test.js
1. describe('PasswordController', function() {
1. beforeEach(module('app'));
1. var $controller;
1. beforeEach(inject(function(_$controller_){
// The injector unwraps the underscores (_) from around the parameter names when matching
1. $controller = _$controller_;
1. }));
1. describe('$scope.grade', function() {
1. it('sets the strength to "strong" if the password length is >8 chars', function() {
1. var $scope = {};
1. var controller = $controller('PasswordController', { $scope: $scope });
1. $scope.password = 'longerthaneightchars';
1. $scope.grade();
1. expect($scope.strength).toEqual('strong');
1. });
1. });
1. });
Пожалуйста, помогите мне, чтобы сделать это.