PhantomJS ReferenceError:Can';找不到变量:性能

PhantomJS ReferenceError:Can';找不到变量:性能,phantomjs,karma-runner,Phantomjs,Karma Runner,我正在尝试使用Karma和PhantomJS作为浏览器运行jasmine测试用例 我得到以下错误: ReferenceError:找不到变量:performance',因为我的代码中添加了Microsoftdev tools提供的性能API 如何消除这个错误?另外,如何防止PhantomJS在运行单元测试用例时出现任何JavaScript错误?性能计时API现在由PhantonJS 2支持。您可以使用karma-phantomjs2-launcherkarma launcher。我在Phanto

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

我得到以下错误:

ReferenceError:找不到变量:performance',因为我的代码中添加了
Microsoft
dev tools提供的性能API


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

性能计时API现在由PhantonJS 2支持。您可以使用
karma-phantomjs2-launcher
karma launcher。

我在PhantomJS 2.1.1中得到了这一点<代码>PhantomJS 2.1.1(Mac OS X 0.0.0)引用错误:找不到变量:性能(http://localhost:9876/_karma_webpack_//5c670e1181742792c3be.worker.js:95)