【发布时间】:2014-01-10 14:54:52
【问题描述】:
这是我尝试过的:
$ git clone https://github.com/angular/angular-seed my_project && cd my_project
$ rm -rf app update_angular.js test/e2e/scenarios.js
$ touch test/e2e/scenarios.js
然后我将AngularJS's official ngMock.$httpBackend docs 中的代码粘贴到:
test/e2e/scenarios.js
'use strict'; // Line 1
function MyController($scope, $http) {...} // Lines 3-22
describe('MyController', function() {...} // Lines 24-87
错误
不幸的是,当我使用 config/karma-e2e.conf 运行测试时,我得到:
ReferenceError: inject is not defined at
http://localhost:9876/base/test/e2e/scenarios.js?1387679134000:31
【问题讨论】:
标签: angularjs karma-runner angularjs-controller angularjs-injector