-
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
Nested test functions hide errors #948
Comments
Yea, seems like the test runner should fail if a test is declared after it's started running tests (or a |
I'm looking to contribute my first PR. Can I have a go at this? (might need a little helping hand :-/ ) Thanks |
@GramParallelo Yes, go ahead. We're happy to handhold you through it :) Jump into https://gitter.im/avajs/ava if you have any questions. |
Can I start looking into this too? |
@pinwen Yes, please. I'm a little lost and also can't put in the time at the moment. Thanks. |
Hey, I've never contributed to an open-source project before. It doesn't look like there has been that much progress on this issue. I was hoping I could help out with this issue? |
I was thinking that a property, like hasBegunRunning, could be set to true in the runner's run method and than checked when the test method was was called. Would that be a good approach? |
@pinwen Are you still working on this issue? |
Actually very surprised we didn't think of this for the ESLint plugin earlier. Created an issue over there avajs/eslint-plugin-ava#131 |
…`test` (#961) Fixes #948. AVA does not support nested / async calls to `test`, but we were not providing a great error message when users attempted that. * added failing test for expected error * tests passed: waiting for review * added test * changed error message * fixed error in test * changed 'hasBegunRunning' to 'hasStarted'
Description
I was just reviewing a PR where a colleague wrote tests in a nested way.
While the sub-tests never execute / show up in the test output they also did not create an error.
I would expect such code as the example below to at least throw an error.
Test Source
Console Output
Config
No config in package.json
Command-Line Arguments
Relevant Links
Environment
Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:
The text was updated successfully, but these errors were encountered: