9

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.

Bae
  • 7,516
  • 5
  • 36
  • 42
  • Hey! What is your test file called and where is it exactly? – Xolv.io Dec 30 '14 at 21:46
  • @TheMeteorTestManual .js where is any file name in the tests/jasmine/client/integration directory. A specific example would be routerSpec.js – Bae Dec 30 '14 at 22:02

1 Answers1

1

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]

Xolv.io
  • 2,483
  • 1
  • 15
  • 17
  • they are tests/jasmine/client/integration/*.js tests. Are these not run on the server at all? How do I setup fixtures needed to run them if that is the case? – Bae Jan 02 '15 at 03:12
  • You can create a Meteor method on the server that you can call from client test. This is also known as a fixture. Any file that you put under /tests directory with the affix `-fixture.*` will be accessible so you can create meteor methods in there. – Xolv.io Jan 02 '15 at 04:26
  • `[velocity-mirror] _user-fixtures: isServer` and `[velocity-mirror] _user-fixtures: startup function` are being logged to the shell that is running meteor, when the file is in `server/_users-fixtures.js` I will try moving this file into test/ – Bae Jan 02 '15 at 10:33
  • And when moved to tests/jasmine/client/integration/_users-fixtures.js the logs no longer log - and the tests now start failing. – Bae Jan 02 '15 at 10:36
  • When moved to tests/jasmine/server/unit/ the file runs but in the local app not the mirror – Bae Jan 02 '15 at 10:39