YUI test error: window.getYUITestResults()

51 Views Asked by At

I have error when I run the YUI tests via PhantomJS using grover:

TypeError: 'undefined' is not a function (evaluating 'window.getYUITestResults()')

I found that this error occurs because I use location.reload() and PhantomJS have problem with this.

1

There are 1 best solutions below

0
Nazar Vynnytskyi On BEST ANSWER

So here is the solution:

if (window['phantom'] || window['_phantom']) return;
location.reload();
  • window['phantom'] - indicates presence PhantomJS, but when you use grover this property is absent :(
  • window['_phantom'] - indicates presence PhantomJS using grover

Using this simple solution you can skip as may code as you want, good luck!