c8 icon indicating copy to clipboard operation
c8 copied to clipboard

Missing files using `c8 report` on windows

Open j03m opened this issue 6 years ago • 3 comments

I'm observing that we are ignoring certain files from the coverage report on windows due to a quirk in the way test-exclude works.

When we get here on windows: https://github.com/bcoe/c8/blob/master/lib/report.js#L253

We end up at this block in include/exclude: https://github.com/istanbuljs/test-exclude/blob/master/is-outside-dir-win32.js#L9 (which is for win32)

This code is sensitive to case. :( The fix will need to go there, but I need to get an approval before I can PR.

But in summary, given the case of paths like dir/filename: D:\dev\some\long / d:\dev\some\long\path\to\my.js this code:

return !minimatch(path.resolve(dir, filename), path.join(dir, '**'), dot);

Will return true, incorrectly indicating that the file is outside our cwd, Whereas including nocase in the options (supplied as dot) will correctly return false.

j03m avatar Dec 28 '19 22:12 j03m

CC: @coreyfarrell

bcoe avatar Dec 30 '19 21:12 bcoe

@bcoe I've commented on the test-exclude issue, I need some guidance before I can implement a patch for this issue.

coreyfarrell avatar Dec 30 '19 22:12 coreyfarrell

I hit this again recently trying to build coverage instrumentation for VS Code's extensions. This is pretty nasty since it seems like V8's coverage reports don't have any specific drive letter casing; I observe both uppercase and lowercase drive letters in the same coverage file.

connor4312 avatar Feb 07 '24 00:02 connor4312