Skip to content

Conversation

@GabiGrin
Copy link

I took a long shot with this PR but hopefully it helps :)

This fix has 2 parts:

  1. When a file that didn't include AVA ran inside the babel.js child process the process will never exit as no piece of code will ever emit the needed events.
    The only way I found around this, because of the complex process nature of the code, is to send a message once AVA runs on a file, and another message when babel finishes. The result is that inside fork.js we can now know if a file that did not include AVA was read and exit if so.
    PS: this only happens in master, not in v0.4.2, probably because the fix in here

  2. If a file didn't include AVA, test results are not emitted and thus an the error in the mentioned issue is is thrown. I filtered the all undefined results to fix this.

Also, added a test that will fail on master / latest published version.

@jamestalmage
Copy link
Contributor

IMO, the proper thing to do in a file without tests is to fail. Helper files should be prefixed with a _ character.

The only way I found around this, because of the complex process nature of the code, is to send a message once AVA runs on a file, and another message when babel finishes

See #208 for my solution to the problem. It's equally convoluted, but does not require sending messages between processes.

@GabiGrin
Copy link
Author

Much more elegant!

I actually got into this issue while running AVA on directly on a folder (via gulp-ava) with other files, but that was just by mistake.

I'll close thi. Thanks!

@GabiGrin GabiGrin closed this Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants