Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 245
Lóránt Pintér Avatar asked Jun 15 '12 11:06

Lóránt Pintér


2 Answers

Try

console.info('foo') 

From the test javascripts.

like image 157
user1338062 Avatar answered Sep 24 '22 06:09

user1338062


Jasmine 1.x

You can use:

jasmine.log("I've got a big log."); 

Jasmine 2+

Use console.log directly, as per douglas-treadwell's comment below.

like image 26
BanksySan Avatar answered Sep 23 '22 06:09

BanksySan