add "istanbul ignore next" auxiliary comment when using istanbul compat mode for babel/register

This commit is contained in:
Sebastian McKenzie 2015-06-02 00:32:07 +01:00
parent 1934c16f0f
commit ff8d90061f

View File

@ -41,10 +41,10 @@ var mtime = function (filename) {
return +fs.statSync(filename).mtime;
};
var compile = function (filename) {
var compile = function (filename, opts = {}) {
var result;
var opts = extend({}, transformOpts);
opts = extend(opts, transformOpts);
// this will be done when the file is transformed anyway but we need all
// the options so we can generate the cache key
@ -97,7 +97,9 @@ if (process.env.running_under_istanbul) {
fs.readFileSync = function (filename) {
if (istanbulMonkey[filename]) {
delete istanbulMonkey[filename];
var code = compile(filename);
var code = compile(filename, {
attachAuxiliaryComment: "istanbul ignore next"
});
istanbulMonkey[filename] = true;
return code;
} else {