You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

istanbul-to-vscode

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istanbul-to-vscode

Converts Istanbul coverage output to VS Code's coverage API

2.1.0
latest
Source
npmnpm
Version published
Weekly downloads
6K
3.24%
Maintainers
1
Weekly downloads
 
Created
Source

istanbul-to-vscode

A utility library that converts Istanbul coverage reports to the format expected by VS Code's test coverage API.

Usage

In simple cases, you can just read the Istanbul report and create the coverage provider that we export:

import { IstanbulCoverageContext } from 'istanbul-to-vscode';

export const coverageContext = new IstanbulCoverageContext();

function activate() {
  // ...

  testRunProfile.loadDetailedCoverage = coverageContext.loadDetailedCoverage;
}

async function runTests() {
  // ...

  await coverageContext.apply(testRun, coverageDir);
}

But often you may want to apply sourcemap mappings. To do that, you can provide additional options either in apply() or when creating the CoverageContext:

async function runTests() {
  // ...

  await coverageContext.apply(task, coverageDir, {
    mapFileUri: (uri) => sourceMapStore.mapUri(uri),
    mapPosition: (uri, position) => sourceMapStore.mapLocation(uri, position),
  });
}

Keywords

vscode

FAQs

Package last updated on 28 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts