avajs / ava-codemods

Codemods for AVA
https://ava.li
MIT License
68 stars 16 forks source link

Automatic file detection #1

Closed jamestalmage closed 5 years ago

jamestalmage commented 8 years ago

For codemods like same => deepEquals, we should just examine the AVA config in package.json to determine which files are test files, which are sources, etc.

We could do similar things for mocha/tap/etc by parsing their configs. (not sure we want to go down that road).

jfmengels commented 8 years ago

I understand your reasoning behind for the first part, but that may not include test helper files. For instance, if your tests are in test.js, and you wrote your assertion helpers (which use t.same()) in test-helper.js, then you would not update the right file.

jamestalmage commented 8 years ago

Right, our code would need to figure that out. The convention is they can be in a helpers folder, or prefixed with a _.

I think we should do this once, in AVA itself, so other modules can reuse it: https://github.com/sindresorhus/ava/issues/700

vadimdemedes commented 8 years ago

And we shouldn't forget about fixtures.