diff --git a/lib/TrivialReporter.js b/lib/TrivialReporter.js index 14c35ea..a7bd114 100644 --- a/lib/TrivialReporter.js +++ b/lib/TrivialReporter.js @@ -59,3 +59,13 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { jasmine.TrivialReporter.prototype.log = function() { console.log.apply(console, arguments); }; + +//protect against console.log incidents +if (!("console" in window) || !("firebug" in console)) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + window.console = {}; + for (var i = 0, len = names.length; i < len; ++i) { + window.console[names[i]] = function() { + }; + } +}