Closed jamestalmage closed 5 years ago
Scanning for describe / it, etc. Should work for mocha.
Jasmine also uses describe
/it
.
Jasmine also uses describe/it.
Good point. Jasmine's assertion API differs from chai enough that I think we could make it automatic.
We could combine with examining devDependencies
. That would be pretty reliable.
Also, we could just abandon this and give them a prompt. People are going to use these pretty rarely, so it may be better to just focus on providing really good, really smart transforms than focusing on little niceties that save them a few keystrokes. Actually, I think that is probably the better choice.
@jamestalmage Why not just check devDependencies
? I can't think of a more reliable way than that.
You technically could have multiple test frameworks used in a large project (and the codemods become more and more valuable, the larger the project)
That honestly sounds like an extreme edge-case and premature concern, but if you really think this could be an issue, just fall back to requiring the user to specify which framework if it's ambiguous.
Also, we could just abandon this and give them a prompt
:+1: , don't see the value of trying to detect it. Feels error-prone and potentially hard (what if the user has two tests frameworks in a pretty big project, wouldn't want to prevent him to apply both transforms)
Automatically detect which test framework a user is currently using.
Scanning the
require
statements should work fortap
andtape
.Scanning for
describe
/it
, etc. Should work formocha
.