HookOptions Class
Object that returns hook options. Note that istanbul does not provide an
option to hook require
. This is always done by the cover
command.
Constructor
HookOptions
-
config
Parameters:
-
config
Objectthe hooks part of the config object
Item Index
Methods
handleSigint
()
Boolean
returns if istanbul needs to add a SIGINT (control-c, usually) handler to save coverage information. Useful for getting code coverage out of processes that run forever and need a SIGINT to terminate.
Returns:
true if SIGINT needs to be hooked to write coverage information
hookRunInContext
()
Boolean
returns if vm.runInThisContext
needs to be hooked, in addition to the standard
require
hooks added by istanbul. This should be true for code that uses
RequireJS for example. Used by the cover
command.
Returns:
true if vm.runInThisContext
needs to be hooked for coverage
postRequireHook
()
String
returns a path to JS file or a dependent module that should be used for
post-processing files after they have been required. See the yui-istanbul
module for
an example of a post-require hook. This particular hook modifies the yui loader when
that file is required to add istanbul interceptors. Use by the cover
command
Returns:
a path to a JS file or the name of a node module that needs
to be used as a require
post-processor