index.js
function hijackLog() {
  var oldLog = console.log;

  console.log = function (message) {

    count(message);
    style();

    var match = (message + '').match(/^# #tapeworm-html(.*)/);
    var isHtml = !!match;

    if (match) {
      var html = match[1];
      var div = testResults.appendChild(document.createElement('div'));
      div.innerHTML = html;
    } else {
      var pre = testResults.appendChild(document.createElement('pre'));
      pre.style.margin = 0;

      pre.innerHTML = message + '\n';
      oldLog.apply(console, arguments);
    }

  };
}
function hijackLog() {
  var oldLog = console.log;

  console.log = function (message) {

    count(message);
    style();

    var match = (message + '').match(/^# #tapeworm-html(.*)/);
    var isHtml = !!match;

    if (match) {
      var html = match[1];
      var div = testResults.appendChild(document.createElement('div'));
      div.innerHTML = html;
    } else {
      var pre = testResults.appendChild(document.createElement('pre'));
      pre.style.margin = 0;

      pre.innerHTML = message + '\n';
      oldLog.apply(console, arguments);
    }

  };
}
function hijackLog ( ) { var oldLog = console . log ; console . log = function ( message ) { count ( message ) ; style ( ) ; var match = ( message + '' ) . match ( / ^# #tapeworm-html(.*) / ) ; var isHtml = ! ! match ; if ( match ) { var html = match [ 1 ] ; var div = testResults . appendChild ( document . createElement ( 'div' ) ) ; div . innerHTML = html ; } else { var pre = testResults . appendChild ( document . createElement ( 'pre' ) ) ; pre . style . margin = 0 ; pre . innerHTML = message + '\n' ; oldLog . apply ( console , arguments ) ; } } ; }
Create a wrapper around console.log
Create a wrapper around console . log