Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gotwarlost committed Jul 11, 2016
1 parent d28153c commit 03866c9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
13 changes: 3 additions & 10 deletions bin/nyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,10 @@ var yargs = require('yargs/yargs')(process.argv.slice(2))
description: 'should nyc handle instrumentation?'
})
.option('hook-run-in-context', {
default: false,
default: true,
type: 'boolean',
description: 'should nyc wrap vm.runInThisContext?'
})
.option('hook-create-script', {
default: false,
type: 'boolean',
description: 'should nyc wrap vm.createScript?'
})
.help('h')
.alias('h', 'help')
.version()
Expand Down Expand Up @@ -179,8 +174,7 @@ if (argv._[0] === 'report') {
exclude: argv.exclude,
sourceMap: !!argv.sourceMap,
instrumenter: argv.instrumenter,
hookRunInContext: argv.hookRunInContext,
hookCreateScript: argv.hookCreateScript
hookRunInContext: argv.hookRunInContext
}))
nyc.reset()

Expand All @@ -191,8 +185,7 @@ if (argv._[0] === 'report') {
NYC_CACHE: argv.cache ? 'enable' : 'disable',
NYC_SOURCE_MAP: argv.sourceMap ? 'enable' : 'disable',
NYC_INSTRUMENTER: argv.instrumenter,
NYC_HOOK_RUN_IN_CONTEXT: argv.hookRunInContext,
NYC_HOOK_CREATE_SCRIPT: argv.hookCreateScript,
NYC_HOOK_RUN_IN_CONTEXT: argv.hookRunInContext ? 'enable' : 'disable',
BABEL_DISABLE_CACHE: 1
}
if (argv.require.length) {
Expand Down
3 changes: 1 addition & 2 deletions bin/wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ try {
enableCache: process.env.NYC_CACHE === 'enable',
sourceMap: process.env.NYC_SOURCE_MAP === 'enable',
instrumenter: process.env.NYC_INSTRUMENTER,
hookRunInContext: process.env.NYC_HOOK_RUN_IN_CONTEXT === 'true',
hookCreateScript: process.env.NYC_HOOK_CREATE_SCRIPT === 'true'
hookRunInContext: process.env.NYC_HOOK_RUN_IN_CONTEXT === 'enable'
})).wrap()

sw.runMain()
5 changes: 0 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ function NYC (opts) {
this.sourceMapCache = libSourceMaps.createSourceMapStore()

this.hookRunInContext = config.hookRunInContext
this.hookCreateScript = config.hookCreateScript

this.hashCache = {}
this.loadedMaps = null
this.fakeRequire = null
Expand Down Expand Up @@ -309,9 +307,6 @@ NYC.prototype._addOtherHooks = function () {
if (this.hookRunInContext) {
this._addHook('RunInThisContext')
}
if (this.hookCreateScript) {
this._addHook('CreateScript')
}
}

NYC.prototype.cleanup = function () {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"url": "[email protected]:bcoe/nyc.git"
},
"bundledDependencies": [
"append-transform",
"arrify",
"caching-transform",
"convert-source-map",
Expand Down
2 changes: 1 addition & 1 deletion test/src/nyc-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ describe('the nyc cli', function () {

describe('hooks', function () {
it('provides coverage for requireJS and AMD modules', function (done) {
var args = [bin, '--hook-run-in-context', process.execPath, './index.js']
var args = [bin, process.execPath, './index.js']

var proc = spawn(process.execPath, args, {
cwd: fixturesHooks,
Expand Down

0 comments on commit 03866c9

Please sign in to comment.