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.
Using the done() Method in Your Jasmine-driven Asynchronous JavaScript Tests. Jasmine. Async is an add-on library for Jasmine that provides additional functionality to do asynchronous testing. Modeled after Mocha's async test support, it brings the done() function to the Jasmine unit testing environment.
Jasmine follows Behavior Driven Development (BDD) procedure to ensure that each line of JavaScript statement is properly unit tested. By following BDD procedure, Jasmine provides a small syntax to test the smallest unit of the entire application instead of testing it as a whole.
ToBeTruthy() This Boolean matcher is used in Jasmine to check whether the result is equal to true or false.
Have you tried the ConsoleReporter?
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.
UPDATE In newer versions of jasmine, ConsoleReporter was removed. You can either use the built-in jsApiReporter, or write your own (console) reporter, as shown in the following link: https://jasmine.github.io/tutorials/custom_reporter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With