karma-runner/karma

File serving should have case-insensitive option

Open

#1,722 创建于 2015年11月24日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)JavaScript (11,918 star) (1,703 fork)batch import
discusshelp wantedtype: feature

描述

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?

贡献者指南

File serving should have case-insensitive option · karma-runner/karma#1722 | Good First Issue