Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use console.log in meteor jasmine tests

I'm using

  • Meteor 1.0.2.1
  • sanjo:jasmine 0.9.1
  • velocity:html-reporter 0.3.2

https://doctorllama.wordpress.com/2014/09/22/bullet-proof-internationalised-meteor-applications-with-velocity-unit-testing-integration-testing-and-jasmine/ says I should be able to use console.log() to see output in the console.

But nothing happens for me.

If I move the call out of tests/jasmine into client/ or server/ then the output is on the terminal where meteor is run.

The html-reporter also has a section called Logs. Looking at the code it appears to have a reactive collection on VelocityLogs. My google-fu is failing me as I can find no information on how to get any output to display in this section.

What is the correct way of logging in jasmine tests?

In Chrome the client side logs are visible through the JavaScript Console. But I still don't know where the server side logs might be.

I've run with DEBUG=1 JASMINE_DEBUG=1 VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 and the console logs do not appear either.

Edit: I've created a repo to provide an example of the problems at https://github.com/baerrach/meteor-velocity-issue-223.

like image 341
Bae Avatar asked Dec 30 '14 12:12

Bae


1 Answers

If you are running server integration tests and they're not appearing, you may have found a bug!

Try running with:

VELOCITY_DEBUG=1 meteor

The logs should appear in the same place as the main meteor logs appear, prefixed with [velocity-mirror]

like image 197
Xolv.io Avatar answered Nov 06 '22 18:11

Xolv.io