Console.log - Disable Escaping for Jasmine ConsoleReporter

8 views
Skip to first unread message

David Feinberg

unread,
Jan 27, 2014, 11:27:15 AM1/27/14
to node-...@googlegroups.com
I'd like to run Jasmine tests and display the results in the console. I have a test suite setup working correctly and "window: {show: false}" in the package.json file. However all the output is being escaped and includes the full path to the file generating the output. This makes the results very difficult to read. Is there anyway to turn off escaping of console.log output?

Desired Output




Current Output


David Feinberg

unread,
Jan 27, 2014, 11:56:35 AM1/27/14
to node-...@googlegroups.com
I was able to get this working with the following options for JasmineConsole reporter (note: this is in my jasmine/boot.js)

  var ConsoleReporter = jasmineRequire.ConsoleReporter();
  var consoleReporter = new ConsoleReporter({
    env: env,
    timer: new jasmine.Timer,
    print: function (contents) {
      if(typeof process !== 'undefined') {
          process.stdout.write(contents);
      } else {
        console.log.apply(console, arguments)
      }
    }
  });
Reply all
Reply to author
Forward
0 new messages