Socket
Socket
Sign inDemoInstall

istanbul-to-vscode

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    istanbul-to-vscode

Converts Istanbul coverage output to VS Code's coverage API


Version published
Weekly downloads
697
decreased by-15.52%
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 28 Mar 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc