karma-runner / karma-runner/karma
Testing fails to test certain files
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
I am using Karma with a React boiler plate. Testing has been fine so far, but i encountered an issue where Karma simply skips a directory.
The directory is built in the same way as all other tested directories, the only notable difference that I was able to identify was that the length of the path seemed to enable or disable the Testing.
### Expected behaviour
Test directory `backoffice/app/components/bootstrap/atoms/CardDeckWrapper/tests/index.tests.js`
### Actual behaviour
Tests skips the file!
### Steps to reproduce the behaviour
1. Name a directory `CardDeckWrapper`
2. Test --> result Test skipped
3. Rename directory `CDW`
4. Test --> result Tested
My hack right now is to create a directory with a SHORT name (that was kind of funny) `FIX`, in which I `require()` the testing files. This allows me to tests every file, but the bug not allowing Karma to go through directories with long names obviously persists.
### Environment Details
- Karma version 1.0.3:
- Relevant part of your `karma.config.js` file
Contributor guide
Research direction
Start by reproducing the failure with `backoffice/app/components/bootstrap/atoms/CardDeckWrapper/tests/index.tests.js` and the shorter `CDW` directory name. Review the relevant `karma.config.js` settings and compare test discovery for both paths. Done means Karma discovers and runs the tests in the long-named directory without the short-directory workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100