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.
请先登录再写评论。
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
Great, thanks. Thought I might be doing something wrong.
What would you recommend for client side JavaScript TDD/BDD?
For client side testing, IMO, Karma is the best choice
Thanks,
I have started playing with mocha, chai, and sinon. Will check out karma too!
Wayne
I've used Karma before. Works nicely.
Thanks!