karma-runner / karma-runner/karma
Make preprocessors ignore node_modules/ by default or use nonegate minimatch option
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Feature request - would it be possible to make `preprocessors` patterns ignore `node_modules/` by default? I have a repository where I'd like to be able to place tests (which need to be preprocessed by Webpack) anywhere, without providing an exhaustive list of the top-level directories they're in.
If I use a pattern like`'**/*.test.js': ['webpack']` in `preprocessors`, it's also picking up a `.test.js` file from deep within one of my dependencies in `node_modules/`, which has included tests in its npm package.
I can't use a leading `!node_modules/` because that will negate the whole pattern, as the `nonegate` minimatch option is not being used - perhaps enabling that option by default would be an easier solution? Since you can only provide one pattern per property in `preprocessors`, it doesn't make sense to pass in a negative pattern.
Contributor guide
Assessment
This issue has not been assessed yet.