Giter Club home page Giter Club logo

web-component-tester-istanbul's Introduction

Web-Component-Tester-Istanbul

Istanbul coverage plugin for web-component-tester.

Use this plugin to collect and report test coverage (via istanbul) for your project on each test run.

Installation

npm install web-component-tester-istanbul --save-dev

Basic Usage

Add the following configuration to web-component-tester's config file.

Example

module.exports = {
  plugins: {
    istanbul: {
      dir: "./coverage",
      reporters: ["text-summary", "lcov"],
      include: [
        "**/*.js"
      ],
      exclude: [
        "polymer/polymer.js",
        "platform/platform.js"
      ]
    }
  }
}

Options

Below are the available configuration options:

dir

The directory to write coverage reports to.

reporters

An array of istanbul reporters to use.

include

Files to include in instrumentation.

exclude

Files to exclude from instrumentation (this trumps files 'included' with the option above).

Coverage Thresholds

In addition to measuring coverage, this plugin can be used to enforce coverage thresholds. If coverage does not meet the configured thresholds, then the test run will fail, even if all tests passed.

This requires specifying the thresholds option for the plugin

Example

The following configuration will cause the test run to fail if less than 100% of the statements in instrumented files are covered by tests.

module.exports = {
  plugins: {
    istanbul: {
      dir: "./coverage",
      reporters: ["text-summary", "lcov"],
      include: [
        "**/*.js"
      ],
      exclude: [
        "polymer/polymer.js",
        "platform/platform.js"
      ],
      thresholds: {
        global: {
          statements: 100
        }
      }
    }
  }
}

web-component-tester-istanbul's People

Contributors

apowers313 avatar ctreatma avatar customcommander avatar dickp avatar hypnoce avatar klathmon avatar t2ym avatar thedeeno avatar timvdlippe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

neovici

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.