Skip to content

Modify coverage ranges for code run in VM  #524

@skerit

Description

@skerit
  • Version: v20.8.1
  • Platform: Linux 6.6.4-arch1-1

I run certain code like this:

let head = '(function(module, exports, require, __dirname, __filename, ' + argument_config.names.join(', ') + ') {"use strict";\n';

let exported_function = libvm.runInThisContext(head + source + '\n/**/})', {
	filename: path,
	lineOffset: -1,
});

And contrary to nyc, c8 is able to create coverage for this.
Unfortunately, because of the added header the coverage positions are wrong.

Would it be possible for c8 to use the lineOffset or columnOffset property somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions