Redirect calls to console.log() to standard output in Jasmine tests

Lóránt Pintér picture Lóránt Pintér · Jun 15, 2012 · Viewed 65.2k times · Source

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() cannot be redirected, is there any other way to log from my tests so that they show up on the Maven build output?

I'm running these tests on Jenkins in a headless fashion, and would like a means to get some debug output from the tests.

Answer

user1338062 picture user1338062 · Apr 1, 2015

Try

console.info('foo')

From the test javascripts.