-
Notifications
You must be signed in to change notification settings - Fork 83
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
coverage path Windws fix #72
Conversation
src/config.js
Outdated
@@ -15,8 +15,10 @@ const { | |||
function getCoveragePaths() { | |||
let paths = []; | |||
const modulePaths = getModulePaths(); | |||
modulePaths.forEach((p) => { | |||
paths.push(path.join(p, '**/*.js')); | |||
modulePaths.forEach(p => { |
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.
Why not use map()
?
src/config.js
Outdated
paths.push(path.join(p, '**/*.js')); | ||
modulePaths.forEach(p => { | ||
// convert back to forward slashes here on Windows for Jest to be happy | ||
p = p.replace(/\\/g, '/'); |
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.
why not using path.normalize()
instead?
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.
It only works with forward slashes, even on Windows. From my understanding, normalize
won't replace backslashes with forward slashes.
Fixes #71