我尝试使用 karma 创建 e2e 测试,并使用 yeoman 创建 jasmine。在我的karma-e2e.conf.js
我添加茉莉花:
files = [
JASMINE,
JASMINE_ADAPTER,
ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,
'test/e2e/**/*.js'
];
需要异步测试,所以我需要使用runs
,,waits
(https://github.com/pivotal/jasmine/wiki/Asynchronous-specs)waitsFor
但如果我尝试使用它:
it('test', function () {
runs(function () {
...
});
});
场景测试运行器返回:
TypeError: Cannot call method 'runs' of null
at runs (http://localhost:8080/adapter/lib/jasmine.js:562:32)
at Object.<anonymous> (http://localhost:8080/base/test/e2e/eduUser.js:42:3)
at Object.angular.scenario.SpecRunner.run (http://localhost:8080/adapter/lib/angular-scenario.js:27057:15)
at Object.run (http://localhost:8080/adapter/lib/angular-scenario.js:10169:18)
我不知道问题出在哪里。你能帮我吗?