ember.js - How to use qunit-bdd with ember-qunit? -
originally posted on mailing list andreas haller, reposting here "qunit-bdd" tag available others use.
ember-qunit adds handy
moduleforhelper 1 can use alternative qunit'smodulefunction. ember-qunit abstracts things never have use module function , don't know if could. question twofold:
- does
describedefacto act samemodule?- how can use ember-qunit's
modulefor/moduleforcomponent?if there no solution #2 yet
describe(modulefor('controller:posts'), function() { … })nice.
describe in qunit-bdd act same module in qunit. difference can nested in qunit-bdd , each level of nesting correspond module call names joined together. example, result in 3 calls module:
describe('foo', function() { it('is function', function() { expect(typeof foo).to.equal('function'); }); describe('#foo', function() { it('says foo', function() { expect(new foo().foo()).to.equal('foo'); }); }); describe('#bar', function() { it('says bar', function() { expect(new foo().bar()).to.equal('bar'); }); }); }); because there no way control module function called, there's no way (yet) use qunit-bdd ember-qunit. discussing how change that. suggestion work, require modification qunit-bdd explicitly ember-qunit. i'd prefer have shared code in ember-qunit , have thin wrapper qunit-bdd. perhaps similar yours, keeping api qunit-bdd same:
describe('postscontroller', testfor('controller:posts', function() { it('has length', function() { expect(this.subject.length).to.be.defined(); }); })); any suggestions appreciated.
Comments
Post a Comment