Godsmith
Godsmith

Reputation: 2612

Is there any way to debug meteor-jasmine client-side unit tests?

I'm writing a small meteor app and simultanously I'm trying to practice TDD. I've run into a small hurdle in that I can't figure out how I can run my Jasmine unit tests through a debugger.

The tests are stored in [project root]/tests/jasmine/client/unit as in the example.

The velocity docs detail how to debug the server-side tests here, but it doesn't mention client-side tests.

I can debug client integration tests; when starting meteor it logs [velocity] jasmine-client-integration is starting a mirror at http://localhost:51259/., and by going there it's possible to debug my tests. But no mirror seems to be created for the client unit tests?

EDIT: in fact it seems like I can debug the client integration tests at localhost:3000 as well. The developer console looks like this:

Chrome developer console

and by adding a breakpoint in miscSpec.js I can debug my integration tests.

Lastly, I know that Meteor-Jasmine writes the output from console.log in the unit tests to [project root]/.meteor/local/log/jasmine-client-unit.log. That is serviceable, but I would prefer to be able to run the tests through a debugger, since I find it easier to figure out what I did wrong.

I'm using

Upvotes: 1

Views: 141

Answers (1)

Godsmith
Godsmith

Reputation: 2612

As a workaround, I have moved all my client unit tests from [project root]/tests/jasmine/client/unit to [project root]/tests/jasmine/client/integration. There does not seem to make much of a difference whether unit tests are run as unit tests or integration tests. In fact, the Velocity docs has almost the exact same description of the two modes.

It would be nicer to be able to debug the tests in a view where you can also select which tests that should be run, just when running Jasmine normally, but perhaps this is in the works.

Upvotes: 0

Related Questions