generator-mocha
generator-mocha copied to clipboard
fix(generator): fix tdd option
cc @eddiemonge
I'm conflicted on this. While using the correct language is good, how many people actually use the suite and test syntax?
Also, having diverging templates means having to change both instances when there is a change. In this case, I don't really see that happening a lot, if ever.'
A third point is that it locks the style to TDD or BDD. While running this directly is not a problem, generators that compose on top of this may break if they previously specified QUnit or something else.
@eddiemonge I agree, updating the templates is not a good way of doing this. We could always search and replace if tdd is specified.
For my part, I always use the bdd way. We could remove the tdd option entirely. It's your call.
If it can be done in one template I'd be ok with this
I'd either drop the --ui option, or keep two templates. if/else inside templates are the worse to maintain.
We could leverage the ejs templates in the test file.
<%= ui.suite %>('suite', function() {
<%= ui.test %>('test', function(done) {
assert.ok(true);
});
});
This snippet is theoratical but this is what I have in mind.