Originally posted on the mailing list by Andreas Haller, reposting here so that the "qunit-bdd" tag will be available for others to use.
ember-qunit adds a handy
moduleForhelper which one can use as an alternative to QUnit'smodulefunction. Now ember-qunit abstracts things so that i never have to use the module function and i don't know if i could. My question is twofold:
- Does
describedefacto act the same asmodule?- How can i use ember-qunit's
moduleFor/moduleForComponent?If there is no solution for #2 yet something like
describe(moduleFor('controller:posts'), function() { … })would be nice.
describein qunit-bdd does mostly act the same asmodulein QUnit. The difference is that they can be nested in qunit-bdd and each level of nesting will correspond to amodulecall with the names joined together. For example, this will result in three calls tomodule:Because there is no way to control what
modulefunction is called, there's no way (yet) to use qunit-bdd with ember-qunit. We are discussing how to change that. Your suggestion could work, but would require modification to qunit-bdd explicitly for ember-qunit. I'd prefer to have the shared code in ember-qunit and then have a thin wrapper for qunit-bdd. Perhaps something similar to yours, but keeping the API to qunit-bdd the same:Any suggestions would be appreciated.