I\'m using Jasmine via the jasmine-maven-plugin, and I would like to see console.log() messages in the Maven build output. Is there a way to achieve this?
If console.log
If you are running in a node env. You could use
process.stdout.write("this will be send to the console");
Ran into the same issue using grunt/karma/jasmine (karma-jasmine 0.2.2) -
To go along with what Dave Sag said, I've found that all my console.log
messages from the code I'm testing run fine, however nothing from my describe() {}
and it() {}
blocks log anything.
I did find that you can log from a beforeEach() {}
block. At least it worked for me :
beforeEach(function() {
this.model = new blahModel();
console.log('this.model = ', this.model);
});
Note that this only logs in the browser console and for some reason won't log in command line. Somewhat strange when the console.log statements from the tested code block do log in the command line. I've also found what seems to be a better approach for consistent logging here.
UPDATE : I'm actually seeing the logging working for it blocks as well, I believe I had other errors that were preventing this.