【发布时间】:2014-10-03 13:40:04
【问题描述】:
当我使用 grover 通过 PhantomJS 运行 YUI 测试时出现错误:
TypeError: 'undefined' 不是函数(评估 'window.getYUITestResults()')
我发现这个错误是因为我使用 location.reload() 而 PhantomJS 有这个问题。
【问题讨论】:
标签: javascript unit-testing phantomjs yui grover
当我使用 grover 通过 PhantomJS 运行 YUI 测试时出现错误:
TypeError: 'undefined' 不是函数(评估 'window.getYUITestResults()')
我发现这个错误是因为我使用 location.reload() 而 PhantomJS 有这个问题。
【问题讨论】:
标签: javascript unit-testing phantomjs yui grover
所以这里是解决方案:
if (window['phantom'] || window['_phantom']) return;
location.reload();
使用这个简单的解决方案,您可以随意跳过代码,祝您好运!
【讨论】: