离子单元测试与Jasmine&因果报警错误(执行0 0错误(0.002秒/ 0秒))

时间:2016-11-22 10:27:49

标签: unit-testing ionic-framework

尝试使用Jasmine&的单元测试运行样本离子选项卡应用程序Karma获取错误执行0 of 0 ERROR(0.002秒/ 0秒)执行karma启动后unit-tests.conf.js

测试用例的测试控制器:

angular.module('starter.controllers', [])

.controller('DashCtrl', function($scope) {})

.controller('ChatsCtrl', function($scope, Chats) {   // With the new view caching in Ionic, Controllers are only called   // when they are recreated or on app start, instead of every page change.   // To listen for when this page is active (for example, to refresh data),   // listen for the $ionicView.enter event:   //   //$scope.$on('$ionicView.enter', function(e) {   //});

  $scope.chats = Chats.all();   $scope.remove = function(chat) {
    Chats.remove(chat);   }; })

.controller('ChatDetailCtrl', function($scope, $stateParams, Chats,$state, $ionicPopup) {   $scope.chat = Chats.get($stateParams.chatId); })

.controller('AccountCtrl', function($scope) {   $scope.settings = {
    enableFriends: true   }; });

App控制器:

angular.module('starter.controllers', [])

.controller('DashCtrl', function($scope) {})

.controller('ChatsCtrl', function($scope, Chats) {
  // With the new view caching in Ionic, Controllers are only called
  // when they are recreated or on app start, instead of every page change.
  // To listen for when this page is active (for example, to refresh data),
  // listen for the $ionicView.enter event:
  //
  //$scope.$on('$ionicView.enter', function(e) {
  //});

  $scope.chats = Chats.all();
  $scope.remove = function(chat) {
    Chats.remove(chat);
  };
})

.controller('ChatDetailCtrl', function($scope, $stateParams, Chats,$state, $ionicPopup) {
  $scope.chat = Chats.get($stateParams.chatId);
})

.controller('AccountCtrl', function($scope) {
  $scope.settings = {
    enableFriends: true
  };
});

请帮忙解决这个问题。

先谢谢, Lokesh Patel

0 个答案:

没有答案