Tobias Bieniek
Tobias Bieniek
it depends âĸ
in general I'm đ I'm just not sure what the `require()` stuff is for đ¤
aka. in-repo-addons, right?
Should be possible, but I'm unclear about how `getWithDefault()` determines when to use the default value. Does it use the default value for everything that is falsey? or only for...
I'd prefer real if conditions
```js moduleFor('helper:format-duration', 'Unit | Helper | format duration', { async beforeEach() { await this.container.lookup('service:intl').loadAndSetLocale('en'); } }); ```
> I presume the setup here is used instead because this is a Ember.Helper.extend() style of helper (as opposed to Ember.Helper.helper(function(){}))? yeah, it's a class-based helper
for future reference, the correct code would be: ```js 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 `factoryFor(...).create()`...
@NullVoxPopuli I think I can reproduce this in an OSS project - clone https://github.com/skylines-project/skylines (frontend is in the `ember` folder) - checkout 824e3f4fd70c12d6bc0b00bbf0e5360a1caf385f - run codemod - check the `fix-table-row.hbs`...
@patocallaghan thanks for the PR. could you move this over to https://github.com/ember-template-lint/ember-template-recast and create the failing test case there? đ