Output jasmine test results to the console

Yosi picture Yosi · Aug 23, 2011 · Viewed 41.2k times · Source


I am using Jasmine (BDD Testing Framework for JavaScript) in my firefox add-on to test the functionality of my code.

The problem is that jasmine is outputing the test results to an HTML file,what I need is to Firebug Console or other solution to output the results.

Answer

Tigraine picture Tigraine · Aug 23, 2011

Have you tried the ConsoleRepoter

jasmine.getEnv().addReporter(new jasmine.ConsoleReporter(console.log));

According to the code Jasmine has the ConsoleReporter class that executes a print function (in this case console.log) that should do what you need.

If all else fails you could just use this as a starting point to implement your own console.log reporter.