量角器错误" jasmine-spec-reporter 2.x与jasmine不兼容< 2.X"即使安装了Jasmine 2.0

时间:2015-04-30 17:01:42

标签: jasmine protractor jasmine-spec-reporter

我添加了jasmine-spec-reporter之后在Protractor中出现了这个错误,即使我的jasmine-core模块是2.0版本

"*******************************************************************
* Oops!                                                           *
* jasmine-spec-reporter 2.x is not compatible with jasmine < 2.x. *
*                                                                 *
* Please consider using jasmine-spec-reporter < 2.0.0.            *
*                                                                 *
*      npm install jasmine-spec-reporter@"<2.0.0" --save-dev      *
*******************************************************************"

1 个答案:

答案 0 :(得分:2)

问题是protractor.conf.js中指定的'jasmine'关键字

,framework: 'jasmine'

解决方案是将其更改为'jasmine2'

,framework: 'jasmine2'

这是他们谈论这个的量角器文档的链接。

https://github.com/angular/protractor/blob/master/docs/jasmine-upgrade.md#in-your-conf-file

指定您要使用jasmine2.x:

exports.config = {
  // Specify you want to use jasmine 2.x as you would with mocha and cucumber.
  framework: 'jasmine2'
};