-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Use same default logic as webpack for identifying the source root #61
Conversation
Added another commit to handle slashes being mixed on Windows. This was resulting in a report html with 2 listed entries, neither of which have coverage! |
coverageMap.files().forEach(path => { | ||
if (!(path in remappedCoverageMap)) { | ||
if (!(util.fixPathSeparators(path) in fixedFilePaths)) { |
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.
You have to module.exports fixPathSeparators in util.js file i think
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.
Ugh... I missed checking that file in... oops!
Codecov Report
@@ Coverage Diff @@
## master #61 +/- ##
=========================================
+ Coverage 97.61% 97.7% +0.09%
=========================================
Files 2 2
Lines 126 131 +5
=========================================
+ Hits 123 128 +5
Misses 3 3
Continue to review full report at Codecov.
|
…defined This now uses the same default logic as webpack for identifying the source root. Based on https://webpack.js.org/configuration/entry-context/#context, if the context is not specified, the current directory that the process is running from should be assumed instead. Align util to mimic this behaviour to ensure paths are correctly de-absoluted during processing.
…indows For whatever reason, the remapped coverage re-creates paths for source files with mixed slashes. This means that the reporter adds duplicate entries that differ only by the joining path separator, confusing the report writer, which fails to report the coverage on either entry.
Unfortunately, I've been unable to get reproduction steps nailed down exactly for the second commit (mixed slashes coming out of coverage report). On the Aurelia TypeScript skeleton with Karma, I get a
Even aligning all the common node modules to the same versions etc hasn't allowed me to reproduce this issue standalone within this project. I'll keep poking... suffice to say that the second patch correctly handles the above issue. |
Apologies on the late reply on this one, I completely missed the PR 😢This looks great to me, merging and cutting a new release now 👍 |
Based on https://webpack.js.org/configuration/entry-context/#context, if the context is not specified, the current directory that the process is running from should be assumed instead.
Align util to mimic this behaviour to ensure paths are correctly de-absoluted during processing.
This addresses an issue reported in aurelia/cli#996 (comment)