-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: stop duplicating names on case-insensitive file systems #192
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I didn't know that. Will review. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
--all
reporting duplicate records for an entry.For example where node's
path.resolve
might provide you withc:\src\main.js
it 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)