Closed grdw closed 7 years ago
I think Jasmine and Mocha are quite popular in the JS world, but I don't know very much about either. I used QUnit and Jasmine a few years ago, but it's been so long that I don't think my opinion counts for much. 😆
Perhaps we might research the different options? Teaspoon looks pretty cool as well
I have some experience with QUnit and that's it. But I used it for a pretty vanilla Javascript application.
I'll research some options and present my findings. 👍 Teaspoon does look really cool. I'll try some of them and see what 'works' nice and easy.
MochaJS looks promosing. For the basic fact that you can run it from the browser 👍 which is really cool. I also know QUnit can do that. I'm only a bit unaware about the whole process of writing specs in Javascript. Will it be something like this (to put it in perspective):
// Quick code example:
describe("d3 topology chart", function () {
before(function() {
this.topologyChart = Topology.Base.new("body", { name: "HV" });
});
test("it renders", function () {
this.topologyChart.draw();
ok($("svg").length > 0);
});
afterEach(function () {
$("body").html("");
});
});
I am currently writing code for the Topology Editor however - as @ChaelKruip pointed out - there are no Javascript specs. It sounds lovely and I know how to write tests in QUnit. However considering we're having a Rails project it might also be worthwhile to checkout teaspoon.
What is your opinion about this matter? @antw