Skip to content
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

Merged
merged 2 commits into from
Jun 28, 2019
Merged

coverage path Windws fix #72

merged 2 commits into from
Jun 28, 2019

Conversation

trevor-bliss
Copy link
Contributor

Fixes #71

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 => {
Copy link
Collaborator

@kevinv11n kevinv11n Jun 28, 2019

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, '/');
Copy link

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?

Copy link
Contributor Author

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.

@trevor-bliss trevor-bliss merged commit e6cd68c into master Jun 28, 2019
@trevor-bliss trevor-bliss deleted the tbliss/coverage-file-paths branch June 28, 2019 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code Coverage option is returning all coverage percents as 0
3 participants