karma-runner/karma

File serving should have case-insensitive option

Open

#1,722 opened on Nov 24, 2015

View on GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (1,703 forks)batch import
discusshelp wantedtype: feature

Repository metrics

Stars
 (11,918 stars)
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