karma-runner / karma-runner/karma

Exclude files from nested directory in preprocessor

Open
#2,575 1 comment 0 reactions 0 assignees View on GitHub
needs: feedback-from-author support
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

I have directory structure like,

```
└── src/
├── index.js
├── index.js.text
├── index.test.js
├── README.txt
├── startuptest.js
├── lib/
| ├── util.js
| ├── util.test.js
| └── filters/
| ├── kalman.js
| └── lowpass.js
├── test/
| ├── main.js
| └── lib/
| ├── filters.js
| └── util.js
└── vendor/
├── jquery.js
└── three/
├── three.js
└── three.fps.js
```

I want a code coverage for all *.js files under src folder expect `src/lib/!(filters)/** ` and `src/!(test)/**,`

I tried,

`{src/**, src/lib/!(filters)/**, src/!(test)/**}/!(*.spec!).js : coverage `

but its excluding everything and giving coverage report only for files under lib folder except filters folder.

Any thoughts on how this can be solved?

Adding OP - http://stackoverflow.com/questions/42105675/karma-config-to-exclude-nested-directories

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported preprocessor pattern against the shown src tree and compare which files are included in the coverage report. Check the linked Stack Overflow context for the intended exclusion semantics; done means JavaScript files are covered while src/lib/filters and src/test are excluded as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.