ember-codemods/ember-qunit-codemod

Not working on helper unit tests

RobbieTheWagner opened this issue · 8 comments

I ran the codemod on https://github.com/shipshapecode/ember-math-helpers/tree/master/tests/unit/helpers and it did not modify any of the unit tests.

It also incorrectly added import { module } from 'qunit'; to tests/test-helper.js.

The issue is that those tests are already plain qunit tests. The codemod currently only attempts to transform test files that use moduleFor*. Seems reasonable to me to make this work though...

I created #42 to track the second issue you mentioned.

OK, so I think the path forward on this is to extract the bits that do nested module processing and add another transform to the repo that only does that part. It would be much less total logic I think (doesn't have to care about this.owner, this.render, this.register, etc rewriting and whatnot).

Thoughts?

@rwjblue are you saying have two codemods, one for the moduleFor* case, and one for vanilla qunit?

@rwwagner90 - Ya, but both would be housed here in this repo...

TBH, I'm not super certain we care to do the extra work of splitting them though. Maybe we should do it all in the single one...

@cibernox / @Turbo87 - Thoughts?

I would vote to just do it all in one. If you're running the codemod, you probably want to opt in to the new syntax for all your tests.

Maybe we should do it all in the single one...

depends on how complex it will get, but I think we should start with a single one and if it gets to big we can still extract later

kk, sounds good to me