Tests.outputMethod = (args...) -> newOutput = args.join "\n" # escape html newOutput = newOutput.replace(/&/g, "&").replace(//g, ">") # highlight the source of the error newOutput = newOutput.replace /\/([^:/]+):([0-9]+):([0-9]+)/, "/$1:$2:$3" document.getElementById("output-div").innerHTML += "
" + newOutput + "
" console.log.apply console, args # PhantomJS will call the tests manually unless navigator.userAgent == 'phantom' # ensure the extension has time to load before commencing the tests document.addEventListener "DOMContentLoaded", -> setTimeout Tests.run, 200