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

fix: add shim for check-coverage on node 0.10 #386

Merged
merged 2 commits into from
Sep 13, 2016
Merged

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Sep 11, 2016

fixes #384

@@ -467,6 +467,9 @@ NYC.prototype.checkCoverage = function (thresholds) {
console.error('ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet global threshold (' + thresholds[key] + '%)')
}
})

// process.exitCode was not implemented until v0.11.8.
if (/^v0\.[0-10]/.test(process.version) && process.exitCode !== 0) process.exit(process.exitCode)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[0-10] matches exactly 0 and 1. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops.

@JaKXz
Copy link
Member

JaKXz commented Sep 11, 2016

isn't official support for 0.10 being dropped soon? I'm guessing this will be the last patch for it?

@bcoe
Copy link
Member Author

bcoe commented Sep 13, 2016

@JaKXz I'd like to support 0.10 for a while longer; as folks upgrade legacy codebases from 0.10 to fancier new Node.js versions, I'd love for nyc to be the tool they use.

@bcoe bcoe merged commit 9ebaea8 into master Sep 13, 2016
@bcoe bcoe deleted the check-coverage-fix branch September 13, 2016 05:03
@isaacs
Copy link
Collaborator

isaacs commented Sep 13, 2016

Rad! I should've known to suspect process.exitCode and go hunting for the source :)

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.

Node v0.10 exits 0 on failed coverage check
4 participants