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

only and --rules/--invalid/--valid #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brettz9
Copy link

@brettz9 brettz9 commented Jan 22, 2020

  • Enhancement: Allow only on test cases or CLI comma-separated --rules and comma-separated --valid=idxOrNegIdx/--invalid=idxOrNegIdx

Fixes #13.

  1. I've implemented such that only only works if --rules is present. I can implement it to work without it, but I thought it was helpful to avoid the extra overhead it necessitates by default.

  2. Note that without a means in ava to dynamically ignore test files, one will still get notices about test files not having tests (for those files where all test cases are filtered out).

  3. Note also that I am checking for 3 config sources. One was added to allow for easier unit testing (within the constructor), and one (including the minimist dependency) was added so as to support regular CLI usage or the double-double-hyphen syntax npm test -- --rule described at https://github.com/avajs/ava/blob/master/docs/recipes/passing-arguments-to-your-test-files.md . However--and ava could be modified to support this too--you don't actually need the extra double-hyphen if you are running from package.json scripts and if the code checks for process.env.npm_config_*, e.g., process.env.npm_config_rules, as I've done in this PR also.

I've also added this which I can remove or alter as needed:

  • npm: Bump peerDeps (eslint) and devDeps (xo)

@brettz9 brettz9 changed the title only only and --rules/--invalid/--valid Jan 22, 2020
…ules` and `--valid=idxOrNegIdx`/`--invalid=idxOrNegIdx`

- npm: Bump peerDeps (eslint) and devDeps (xo)
@brettz9
Copy link
Author

brettz9 commented Mar 4, 2020

Any chance you can take a look at this?

@brettz9
Copy link
Author

brettz9 commented Mar 21, 2020

@sindresorhus : Are you involved on this project? If so, as it ties in to sindresorhus/eslint-plugin-unicorn#501 , an issue you favored, I was hoping you might be able to take a look?

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.

Ability to run only specified tests
1 participant