Socket
Socket
Sign inDemoInstall

@jsdevtools/coverage-istanbul-loader

Package Overview
Dependencies
5
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jsdevtools/coverage-istanbul-loader

A Webpack loader that uses Istanbul to add code coverage instrumentation


Version published
Weekly downloads
407K
decreased by-0.23%
Maintainers
2
Install size
9.38 MB
Created
Weekly downloads
 

Readme

Source

Istanbul code coverage loader for Webpack

Cross-Platform Compatibility Build Status

Coverage Status Dependencies

npm License

This is a Webpack loader that uses Istanbul to add code coverage instrumentation to your code. This is especially useful for in-browser testing, in a tool like Karma, where you can use karma-coverage-istanbul-reporter to output code coverage data in a variety of formats that are supported by services like Coveralls or Codacy.

Coverage Istanbul Loader is based on Istanbul Instrumenter Loader, but uses a newer version of the Istanbul API and has better support for source maps.

Usage

See the examples folder for usage examples for various use cases.

  • "hello, world" example
    This is the most simplistic example. It just uses coverage-istanbul-loader with its default options to produce an output bundle that contains code coverage instrumentation.

  • TypeScript example
    This example demonstrates using coverage-istanbul-loader with transpiled code. It correctly maps the instrumented JavaScript code back to the original TypeScript source code.

  • Karma example
    This example demonstrates using coverage-istanbul-loader with Karma and karma-coverage-istanbul-reporter to produce code coverage reports for browser tests.

  • Example with options
    This example demonstrates passing options to coverage-istanbul-loader. The options are passed-on to istanbul-lib-instrument, so all the same options are supported.

Contributing

Contributions, enhancements, and bug-fixes are welcome! File an issue on GitHub and submit a pull request.

Building/Testing

To build/test the project locally on your computer:

  1. Clone this repo
    git clone https://github.com/JS-DevTools/coverage-istanbul-loader.git

  2. Install dependencies
    npm install

  3. Build the code
    npm run build

  4. Run the tests
    npm test

License

coverage-istanbul-loader is 100% free and open-source, under the MIT license. Use it however you want.

Big Thanks To

Thanks to these awesome companies for their support of Open Source developers ❤

Travis CI SauceLabs Coveralls

Keywords

FAQs

Last updated on 06 Mar 2020

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