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 modulefor helper 1 can use alternative qunit's module function. ember-qunit abstracts things never have use module function , don't know if could. question twofold:

  1. does describe defacto act same module?
  2. 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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -