fix: stop duplicating names on case-insensitive file systems#192
fix: stop duplicating names on case-insensitive file systems#192j03m wants to merge 2 commits intobcoe:masterfrom
Conversation
bac4792 to
4cbd4cd
Compare
Pull Request Test Coverage Report for Build 536
💛 - Coveralls |
4cbd4cd to
991ac71
Compare
991ac71 to
f6ec698
Compare
f6ec698 to
61a9792
Compare
|
|
||
| add (value) { | ||
| if (this._win32) { | ||
| value = value.toLowerCase() |
There was a problem hiding this comment.
My concern is that I think Windows can have case sensitivity enabled? see this article.
I wonder if we could find a way to feature detect case sensitivity, rather than basing it on Windows?
There was a problem hiding this comment.
Oh I didn't know that. Will review. Thanks!
There was a problem hiding this comment.
I looked into that for jest and didn't find a nice way (suggested solutions was writing a file and reading it with different casing, but it had some caveats).
If you do find a nice way, please publish it as a separate module and we can use it in Jest as well 😀
There was a problem hiding this comment.
@SimenB did you publish a module for the approach used by Jest? otherwise I'd be happy to pull together a module that at least exposes the hack.
There was a problem hiding this comment.
No, we gave up and just check for platform === 'win32' 😞 So please put together a module! Would be cool if Node itself could expose something...
|
Just noting an update here - we're going to put this on hold in favor of creating a separate module in istanbul that can detect case sensitivity of the file system. See: istanbuljs/test-exclude#44 |
|
Closing this. Will try to create a module this weekend. |
I found that on win32, if the v8 script name was set using "legal" (I'm using that term loosely, because it probably shouldn't be done by the embedder), but mismatched casing for a file path, it would result in
--allreporting duplicate records for an entry.For example where node's
path.resolvemight provide you withc:\src\main.jsit would be perfectly fine on windows to tell v8 that the script resource wasc:\src\MAIN.js. If you then try to measure coverage with all, the mismatch in casing between v8's blobs and node's file system results cause the system to report duplicate empty records for files that are actually in the blobs, just differ on case.Prior to my fix test output vs the correct snapshot would like like:
Checklist
npm test, tests passingnpm run test:snap(to update the snapshot)