Socket
Socket
Sign inDemoInstall

@vitest/coverage-c8

Package Overview
Dependencies
Maintainers
3
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/coverage-c8

C8 coverage provider for Vitest


Version published
Weekly downloads
200K
increased by4.7%
Maintainers
3
Weekly downloads
 
Created

What is @vitest/coverage-c8?

@vitest/coverage-c8 is an npm package that integrates with Vitest to provide code coverage reporting using the c8 library. It helps developers measure how much of their code is being tested, ensuring that their tests cover the necessary parts of their application.

What are @vitest/coverage-c8's main functionalities?

Basic Coverage Reporting

This configuration enables basic coverage reporting using c8. It specifies the coverage provider as 'c8' and sets up multiple reporters to output coverage data in text, JSON, and HTML formats.

module.exports = {
  coverage: {
    provider: 'c8',
    reporter: ['text', 'json', 'html'],
  },
};

Custom Coverage Directory

This configuration allows you to specify a custom directory for storing coverage reports. By setting the 'reportsDirectory' option, you can control where the coverage data is saved.

module.exports = {
  coverage: {
    provider: 'c8',
    reporter: ['text', 'json', 'html'],
    reportsDirectory: './custom-coverage',
  },
};

Excluding Files from Coverage

This configuration demonstrates how to exclude certain files or directories from coverage reporting. The 'exclude' option takes an array of glob patterns to specify which files should be ignored.

module.exports = {
  coverage: {
    provider: 'c8',
    reporter: ['text', 'json', 'html'],
    exclude: ['**/node_modules/**', '**/test/**'],
  },
};

Other packages similar to @vitest/coverage-c8

Keywords

FAQs

Package last updated on 20 Mar 2023

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc