GithubHelp home page GithubHelp logo

knisterpeter / ankara Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 232 KB

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

License: BSD 3-Clause "New" or "Revised" License

TypeScript 87.93% JavaScript 12.07%

ankara's Introduction

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.