-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render calls in before/beforeEach aren't converted #32
Comments
This sounds like the same issue in: #26. would you mind confirming? I'm picking the codemod up again today to see if I can get it rewriting properly. |
Yes it seems like the same issue to me. Thanks for making a fix! |
cool thanks! no problem. I think I may have fixed the issue here: https://github.com/efx/ember-mocha-codemods/tree/fix-14 |
I ran it on a file, here is the before and after. While it did convert the render to the one imported from beforeEach(function () {
this.render(hbs`{{my-component
isActiveCollection=true
collection=collection
}}`);
}); beforeEach(function () {
render(hbs`{{my-component
isActiveCollection=true
collection=collection
}}`);
}); |
Here's an input file import { expect } from 'chai';
import {
beforeEach,
context,
describe,
it,
} from 'mocha';
import { setupComponentTest } from 'ember-mocha';
import hbs from 'htmlbars-inline-precompile';
describe('Integration | Component | my-component', function () {
setupComponentTest('my-component', {
integration: true,
});
context('when in some situation or another', function () {
beforeEach(function () {
this.render(hbs`{{my-component}}`);
});
it('should do the thing', function () {
expect(true).to.be.true;
});
});
}); I ran it thru your fork with |
sweet, thanks for checking. I have found a few other bugs too. I will add this snippet above as a test too. |
@apellerano-pw I just updated the branch with a passing test accounting for the |
Oh, if the problem was that the
|
good point. I think a new ticket is best so we can keep the PR's smaller. |
I made #37 for it |
Sometimes when tests have similar setups we use a
beforeEach
to callrender
. The codemod does a good job convertingit
usages to async functions but misses functions passed to other mocha hooksThe text was updated successfully, but these errors were encountered: