-
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
Some thoughts on AVA #469
Comments
Thank you for taking the time & effort to dig into AVA and report your thoughts back to us, we really appreciate that. Below are my comments on your suggestions/statements.
At the moment, I don't see that happening, as ES2015 support in tests out-of-the-box is one of they key selling points of AVA. Also, rich assertions rely on babel too. So removing babel would also mean removing one of the coolest features.
I was actually thinking to do the opposite (#424). Be able to turn off AVA's babel, so that user is free to set it up however he wants. Imho it would satisfy both sides.
This essentially is related to the previous answer. However, I'd like to note that we always transpile and cache test files before running any tests.
It's not true anymore, since we added babel caching to AVA. If there's a cached version of a file, we don't even require babel at all. Hope I clarified a few things, let me know if you've got any more questions or suggestions. |
About caching, I've noticed AVA caches test files, but not source files, maybe I missed that? |
Yes, exactly, AVA transpiles & caches only test files, not source files. |
@tomazzaman I've opened #577 for your source file transpilation suggestion. Watch mode is in 0.12 now (undocumented) and #448 would allow Babel to be disabled if you so desired. Thanks! |
I went through the code yesterday and have a pretty good idea of it's inner workings so I'd like to give a bit more extensive input and suggestions how it could be made a bit simpler and less opinionated (mostly about babel):
babel: true
key would be added to the configuration and AVA would take my project's babel configuration (either in.babelrc
orpackage.json
) to transpile files. This would allow me to to use babel in exactly the same way I use it in development - meaning I could easily use JSX in tests. I configured babel to best fit my needs and I don't like AVA forcing me its configuration which is different.sources
key (glob) which would make AVA transpile sources (and cache them) before running any tests. This would be great for the runner's performance because it wouldn't need to require babel runtime but would just load the files from cache. Requiring the runtime with every forked process adds roughly 300ms to execution time, regardless whether any files were changed from the previous run or not. It's unnecessary imho.Here's how my development process would look like ideally (with babel support):
./node_modules/.cache/ava
)Let me know what you think.
The text was updated successfully, but these errors were encountered: