Skip to content
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

Support for config file? #650

Closed
jescalan opened this issue Mar 16, 2016 · 2 comments · May be fixed by sramam/ava#16 or awaisab172/ava#19
Closed

Support for config file? #650

jescalan opened this issue Mar 16, 2016 · 2 comments · May be fixed by sramam/ava#16 or awaisab172/ava#19

Comments

@jescalan
Copy link

Mocha has this lovely feature where you can add a mocha.opts file to the test folder, and when you run it, it will pick up this file if it exists and use the specified options when it runs. So for example, with ava often times I use the following options whenever I run it:

--require babel-core/register
--verbose
--serial

Now, usually these are wrapped up by the npm test command in package.json so I don't have to type them out often. But if I wanted to just run one of my test files instead of all of them because I'm just working on that feature, I'd want to point ava to that path, which means I'm running it from the command line. Then I need to go copy all these options or it won't run correctly.

For this use case specifically, having an ava.opts file would be awesome. Instead of typing out a massive command with all these options, you could just run ava tests/your_file.js and it would be off to the races.

Implementing this seems like it would be fairly straightforward -- just a check if that file exists and if so add to the options. It could even be json or yaml, that would also be fine. If you are ok with this feature, I'd be happy to write it and open up a PR, just wanted to check first!

@sindresorhus
Copy link
Member

This is already supported. Just put your CLI flags as config in package.json: https://github.com/sindresorhus/ava#configuration

@sindresorhus sindresorhus changed the title opts file? Support for config file? Mar 16, 2016
@jescalan
Copy link
Author

Ah great, don't know how I missed that one. Thanks! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants