Socket
Socket
Sign inDemoInstall

ankara-coverage

Package Overview
Dependencies
28
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ankara-coverage

Code coverage tool leveraging babylon to cover es6/es7 and strawman proposals


Version published
Maintainers
1
Install size
1.15 MB
Created

Readme

Source

ankara

GitHub license Build Status Dependency Status devDependency Status npm version

Code coverage tool leveraging babylon to cover es6/es7 and strawman proposals.

Usage

Installation

Install as npm package:

npm install ankara-coverage --save-dev

Configuration

ankara is reading its configuration from an optional '.ankara.json' file in your project root.

{
  "extensions": [
    ".js"
  ],
  "files": [
    "path/to/main.js"
  ],
  "excludes": [
    "**/node_modules/**"
  ]
}
  • The extensions key are all valid file types which should be covered.
  • The files key should contain the main application/library entry points. This is only requried if the ankara instrument binary is used.
  • The excludes key should contain all sources not covered. This defaults to '**/node_modules/**'

Execution

To create an lcov coverage report the easiest method is to create a wrapper script which executes the test. Then call this script with the ankara cover command.

./node_modules/.bin/ankara cover <script-to-run-your-tests>

Optionally one can use two steps.

First instrumenting your code:

./node_modules/.bin/ankara instrument

Then execute your tests with the covered sources.

Second generating lcov report:

./node_modules/.bin/ankara lcov

The instrumentation step could be done automatically with the provided require hook. Just import (or require) the register file from ankara.

import 'ankara/dist/register';

Note: The register task is compatible with other register tasks but must be required as last step. This will then replace the previous registered tasks and execute them after instrumentation (e.g. babeljs/register).

FAQs

Last updated on 29 Oct 2015

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