New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@theintern/istanbul-loader

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@theintern/istanbul-loader

A webpack loader that adds code coverage instrumentation

  • 1.0.0-beta.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

istanbul-loader

This is a webpack loader that uses istanbul-lib-instrument to add code coverage instrumentation to JavaScript files.

Installation

Install with

npm install @theintern/istanbul-loader --save-dev

Usage

Install the loader in a project and add an entry for it to the project's webpack.config:

module: {
    rules: [
        {
            test: /src\/.*\.ts$/,
            use: '@theintern/istanbul-loader'
        },
		...
    ]
}

Note that the istanbul-loader should be run after transpilers such as TypeScript. This means that it should come before transpilers in a loader list, or use enforce: 'post':

rules: [
    {
	    test: /src\/.(\.ts$/,
		use: [ '@theintern/istanbul-loader', 'ts-node' ]
	},
	...
]

or

rules: [
    {
	    test: /src\/.(\.ts$/,
		use: '@theintern/istanbul-loader',
		enforce: 'post'
	},
	...
]

Configuration

The rule test should only match source files, not all .ts or .js files, so as not to instrument tests or support files.

Options can be passed using the standard webpack options property:

rules: [
    {
	    test: /src\/.(\.ts$/,
		use: {
			loader: '@theintern/istanbul-loader',
			options: { config: 'tests/intern.json' }
		}
	},
	...
]

Currently the only option used by the loader is 'config', which should point to an Intern config file. The loader will use values for coverageVariable and instrumenterOptions from the Intern config, if present.

License

Intern is a JS Foundation project offered under the New BSD license.

© SitePen, Inc. and its contributors

Keywords

FAQs

Package last updated on 09 Jul 2021

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