-
Notifications
You must be signed in to change notification settings - Fork 19
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
TypeError: helper.compute is not a function #17
Comments
Was there a custom subject definition before? Can you share the moduleFor setup invocation? |
We for sure do not currently support a custom subject definition. If that was it, then this is roughly the same as #12. |
moduleFor('helper:format-duration', 'Unit | Helper | format duration', {
async beforeEach() {
await this.container.lookup('service:intl').loadAndSetLocale('en');
}
}); |
I don’t think this is a standard setup here and I’m unsure what exactly is the best path forward. I believe that the default helper tests just import the helpers compute function and test it with “plain qunit”. I presume the setup here is used instead because this is a Ideally, this test would be updated to actually render the helper (e.g. |
yeah, it's a class-based helper |
for future reference, the correct code would be: let helper = this.owner.factoryFor('helper:format-duration').create();
// before: let helper = this.subject();
let result = helper.compute([convertToMS(59, 'minutes')]);
assert.equal(result, '59 min'); tl;dr |
I made some changes in Ember itself (should be included in 2.17 release next week) to allow the same |
Based on ^, I am going to update the codemod to transform |
fails with:
The text was updated successfully, but these errors were encountered: