aboutsummaryrefslogtreecommitdiff
path: root/node_modules/nyc/index.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/nyc/index.js
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/nyc/index.js')
-rwxr-xr-xnode_modules/nyc/index.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/node_modules/nyc/index.js b/node_modules/nyc/index.js
index b31c1abcf..87ada2daf 100755
--- a/node_modules/nyc/index.js
+++ b/node_modules/nyc/index.js
@@ -79,6 +79,7 @@ function NYC (config) {
}.bind(this), {})
this.hookRunInContext = config.hookRunInContext
+ this.hookRunInThisContext = config.hookRunInThisContext
this.fakeRequire = null
this.processInfo = new ProcessInfo(config && config._processInfo)
@@ -311,6 +312,9 @@ NYC.prototype._wrapRequire = function () {
NYC.prototype._addOtherHooks = function () {
if (this.hookRunInContext) {
+ this._addHook('RunInContext')
+ }
+ if (this.hookRunInThisContext) {
this._addHook('RunInThisContext')
}
}
@@ -420,9 +424,15 @@ NYC.prototype._getCoverageMapFromAllCoverageFiles = function () {
this.loadReports().forEach(function (report) {
map.merge(report)
})
- map.filter(function (filename) {
- return _this.exclude.shouldInstrument(filename)
- })
+ // depending on whether source-code is pre-instrumented
+ // or instrumented using a JIT plugin like babel-require
+ // you may opt to exclude files after applying
+ // source-map remapping logic.
+ if (this.config.excludeAfterRemap) {
+ map.filter(function (filename) {
+ return _this.exclude.shouldInstrument(filename)
+ })
+ }
map.data = this.sourceMaps.remapCoverage(map.data)
return map
}