You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{expect}from'chai';import{beforeEach,describe,it}from'mocha';import{setupComponentTest}from'ember-mocha';importhbsfrom'htmlbars-inline-precompile';describe('Integration | Component | foo',function(){setupComponentTest('foo',{integration: true});[true,false].forEach((blah)=>{beforeEach(function(){this.set('blah',blah);this.render(hbs`{{foo bar=blah}}`);});it('should do the thing',function(){expect(true).to.be.true;});});});
expected output: the this.render in beforeEach is converted to an await render and function made async.
actual output:
import{expect}from'chai';import{beforeEach,describe,it}from'mocha';import{setupRenderingTest}from'ember-mocha';import{render}from'@ember/test-helpers';importhbsfrom'htmlbars-inline-precompile';describe('Integration | Component | foo',function(){setupRenderingTest();[true,false].forEach((blah)=>{beforeEach(function(){this.set('blah',blah);render(hbs`{{foo bar=blah}}`);});it('should do the thing',function(){expect(true).to.be.true;});});});
The async/await part seems to be what messes up
The text was updated successfully, but these errors were encountered:
apellerano-pw
changed the title
nested beforeEach not converted
beforeEach nested in a loop is not converted
Oct 8, 2018
The problem is most likely the forEach call here. We only convert those hooks inside describe blocks because we can't be sure that the other thing would be correct without actually evaluating the code.
input:
expected output: the
this.render
inbeforeEach
is converted to anawait render
and function made async.actual output:
The async/await part seems to be what messes up
The text was updated successfully, but these errors were encountered: