-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement static analysis of test files (Blocker for #78). #696
Comments
Whatever we decide to support via static analysis, we need to have a well defined behavior for when it fails (either with a false-positive for In the case of
|
We could do very conservative analysis and rewrite the |
Just making sure I understand. Rewrite I am tempted to agree with it because it seems easier than static analysis. At the same time, I think this cripples a pretty key use case (watch mode and helper generated tests). |
Yea, only statically recognized Your suggestions in #696 (comment) seem on point. The only remaining issue seems to be "If a user specified the .only extension however, I think it's really problematic to make the user wait while we launch additional files (possibly hundreds) to verify they have no .only calls." We could modify the progress spinner to say "looking for exclusive tests in [filename]". Hitting |
I think we cycle through all the tests once in watcher mode, guaranteeing all the We could use |
I have a start on static analysis here: avajs/babel-plugin-ava-test-data#1 |
Yea happy to shift some of these advanced use cases into watch mode. It's AVA on steroids!
Indeed. Do you think we should alert users when we encounter a dynamic |
I am not sure what to do with dynamic Should dynamic We should definitely print a warning. |
If it fails CI you'll notice. |
That's what I was thinking |
In lieu of this we're going for #1472. |
Blocks #78.
We need a way to do static analysis of test files, specifically to discover if any use exclusive tests (i.e.
test.only
).There are plenty of complications:
Naming the AVA import something other than test:
Storing a reference to a
test.only
for reuse:Similar can also be achieved with import statements:
Or require statements:
Dynamically generating tests (see [Idea]: test macros #695 possible solution).
Non-constant variables (variables that are reassigned after declaration, not referring to
const
here):It seems possible to support
1
and2
without a lot of pain.3
quickly becomes impossible. I think #695 provides a solution that would allow us to cover most use cases for dynamically generating tests and still give us the ability to do the static analysis we need to.4
just seems silly and probably not very likely in practice.The text was updated successfully, but these errors were encountered: