这是我尝试过的:
$ 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 官方ngMock.$httpBackend
文档中的代码粘贴到:
测试/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