PhantomJS ReferenceError:无法找到变量:performance

时间:2015-03-23 10:49:49

标签: phantomjs karma-runner

我正在尝试使用Karma和PhantomJS作为浏览器运行jasmine测试用例。

我收到以下错误:

  

ReferenceError:无法找到变量:performance'因为我的代码中添加了Microsoft dev工具提供的性能API。

如何摆脱这个错误?另外,在运行单元测试用例时,如何防止PhantomJS出现任何JavaScript错误?

1 个答案:

答案 0 :(得分:2)

PhantonJS 2现在支持性能计时API,您可以使用karma-phantomjs2-launcher Karma启动器https://www.npmjs.com/package/karma-phantomjs2-launcher