Possible to debug NodeJS Jasmine-node tests in Webstorm IDE?

Is it possible to debug Jasmine-node unit tests in Webstorm?

I can run Jasmine-node from the commandline, no problem. But I would like to debug my unit tests in Webstorm.

When I run my test spec file using the NodeJS debugger in webstorm, I get errors like "describe" is not defined.

For example, my code:

  
var mongoose = require('mongoose'),
    Budget = require('../src/models/budgetModel');


describe("Budget repository", function () {
    beforeAll(function (done) {
        this.db = mongoose.connect('mongodb://localhost/budget_test');
        _seedDb(done);
        console.log('Seeded db...');
    });

});


I know Karma is a supported test runner, but I read Karma is only for Browser based tests, not NodeJS tests.

7 comments

Jasmine-node is not currently supported, please follow https://youtrack.jetbrains.com/issue/WEB-1864 for updates.
I'd suggest using Mocha instead for testing server-side code

0

Great, thanks. Thought I might be doing something wrong.

0

What would you recommend for client side JavaScript TDD/BDD?

0

For client side testing, IMO, Karma is the best choice


0

Thanks,

I have started playing with mocha, chai, and sinon.  Will check out karma too!

Wayne

0

I've used Karma before. Works nicely.

0

Please sign in to leave a comment.