Skip to content

Commit

Permalink
ensure that writing code coverage always happens last
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Coe committed May 19, 2015
1 parent 812260d commit 4d920ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ NYC.prototype._wrapExit = function () {
)
}

onExit(function () {
outputCoverage()
})
var opts = {alwaysLast: true}
// we're running as a unit test.
if (process.env.TAP) opts.maxListeners = 2
onExit(function () {
outputCoverage()
}, opts)
}

NYC.prototype.wrap = function (bin) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"lodash": "^3.8.0",
"mkdirp": "^0.5.0",
"rimraf": "^2.3.3",
"signal-exit": "^1.2.0",
"spawn-wrap": "^0.1.1",
"signal-exit": "^1.3.0",
"spawn-wrap": "^0.1.2",
"strip-bom": "^1.0.0",
"yargs": "^3.8.0"
},
Expand Down

0 comments on commit 4d920ef

Please sign in to comment.