karma-runner / karma-runner/karma

File serving should have case-insensitive option

Open
#1,722 5 comments 0 reactions 0 assignees View on GitHub
discuss help wanted type: feature
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

When working on Windows, most files can be accessed in a case-insensitive fashion. This can result in builds working (files are found by the operating system, and compiled into assets), but tests not working unless every reference to the file is the same casing. This is a problem, especially using ES6 module syntax.

Can an option be inserted which would allow Karma to match file names with a custom resolver function? Right now, there's a `===` going on, to see if a file exists in Karma's directory. I have attempted to resolve this via proxies, but have not had much luck since it doesn't really seem to be the intended use case.

I imagine the change would be very small. This is the line of code which would be affected (https://github.com/karma-runner/karma/blob/master/lib/middleware/source_files.js#L9), I'd like to make that configurable. Is this aligned with the intent of how Karma should work?

Contributor guide

Open the contributing guide

Research direction

Start at lib/middleware/source_files.js line 9, where the issue identifies the filename comparison, and trace how file-serving options are configured. Determine where a custom resolver option would enter the existing flow; done means the matching behavior can be configured without changing default behavior and is covered by the relevant test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
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.