我正在尝试使用Karma和PhantomJS作为浏览器运行jasmine测试用例。
我收到以下错误:
ReferenceError:无法找到变量:performance'因为我的代码中添加了
Microsoft
dev工具提供的性能API。
如何摆脱这个错误?另外,在运行单元测试用例时,如何防止PhantomJS出现任何JavaScript错误?
答案 0 :(得分:2)
PhantonJS 2现在支持性能计时API,您可以使用karma-phantomjs2-launcher
Karma启动器https://www.npmjs.com/package/karma-phantomjs2-launcher。