slimerjs icon indicating copy to clipboard operation
slimerjs copied to clipboard

Suppress JS warnings

Open Swatinem opened this issue 11 years ago • 3 comments

I get a ton of JS warnings on the console, like:

JavaScript strict warning: http://localhost:57698/mocha.js, line 4811: anonymous function does not always return a value
JavaScript warning: http://localhost:57698/build.js, line 569: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead

This is very annoying. I will take a look into it.

Swatinem avatar Mar 05 '14 11:03 Swatinem

I agree that there should be a way to suppress JS warnings. I rely on console output to determine the outcome of my tests and this would make it much easier to read.

ghost avatar May 19 '14 05:05 ghost

Add this to your scripts, it will swallow page errors, allowing for clean output.

page.onError = function() { }; page.onResourceError = function() { };

ghost avatar Dec 10 '14 13:12 ghost

I wonder which function deal with this kind of console.I want to filter this error message and when some specific error appears just exit and log I change the page.onError page.onResourceError page.onConsoleMessage phantom.onError function.But the error stay still.

amanda94 avatar Feb 02 '18 03:02 amanda94