我无法弄清楚我在这个测试中做错了什么。这是我对该项目的第一次测试。
describe('Controller: landingCtrl', function () {
var scope;
beforeEach(angular.mock.module('myWebApp'));
beforeEach(angular.mock.inject(function($rootScope, $controller) {
scope = $rootScope.$new();
scope.filters = {
date: 'This Week'
};
$controller('landingCtrl', {
$scope: scope
});
}));
it('dateFilter should return true', function () {
expect(true).toBe(true);
});
});
这是输出:
Firefox 34.0.0 (Windows) Controller: landingCtrl dateFilter should return true FAILED
minErr/<@app/bower_components/angular/angular.js:63:12
loadModules/<@Capp/bower_components/angular/angular.js:4138:15
forEach@app/bower_components/angular/angular.js:323:11
loadModules@app/bower_components/angular/angular.js:4099:5
createInjector@app/bower_components/angular/angular.js:4025:11
workFn@app/bower_components/angular-mocks/angular-mocks.js:2425:44