File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ function NYC (config) {
7979 } . bind ( this ) , { } )
8080
8181 this . hookRunInContext = config . hookRunInContext
82+ this . hookRunInThisContext = config . hookRunInThisContext
8283 this . fakeRequire = null
8384
8485 this . processInfo = new ProcessInfo ( config && config . _processInfo )
@@ -311,6 +312,9 @@ NYC.prototype._wrapRequire = function () {
311312
312313NYC . prototype . _addOtherHooks = function ( ) {
313314 if ( this . hookRunInContext ) {
315+ this . _addHook ( 'RunInContext' )
316+ }
317+ if ( this . hookRunInThisContext ) {
314318 this . _addHook ( 'RunInThisContext' )
315319 }
316320}
Original file line number Diff line number Diff line change @@ -173,6 +173,12 @@ Config.buildYargs = function (cwd) {
173173 global : false
174174 } )
175175 . option ( 'hook-run-in-context' , {
176+ default : true ,
177+ type : 'boolean' ,
178+ description : 'should nyc wrap vm.runInContext?' ,
179+ global : false
180+ } )
181+ . option ( 'hook-run-in-this-context' , {
176182 default : true ,
177183 type : 'boolean' ,
178184 description : 'should nyc wrap vm.runInThisContext?' ,
Original file line number Diff line number Diff line change 8484 "foreground-child" : " ^1.5.3" ,
8585 "glob" : " ^7.0.6" ,
8686 "istanbul-lib-coverage" : " ^1.1.1" ,
87- "istanbul-lib-hook" : " ^1.0.7 " ,
87+ "istanbul-lib-hook" : " ^1.1.0 " ,
8888 "istanbul-lib-instrument" : " ^1.8.0" ,
8989 "istanbul-lib-report" : " ^1.1.1" ,
9090 "istanbul-lib-source-maps" : " ^1.2.1" ,
You can’t perform that action at this time.
0 commit comments