wct-istanbul
Istanbul coverage reporting for projects being tested by web-component-tester
Last updated 2 years ago by t2ym .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install wct-istanbul 
SYNC missed versions from official npm registry.

npm version

wct-istanbul

A fork of web-component-tester-istanbul Istanbul coverage plugin for web-component-tester@^6.6.0.

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

Supported syntax

Syntax Status
ES2015+
ES Modules
object rest/spread properties
async/await
import.meta
async iterator

Notes

Installation

npm install --save-dev wct-istanbul

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
        }
      }
    }
  }
}

Current Tags

  • 0.14.3                                ...           latest (2 years ago)
  • 0.13.0-pre.1                                ...           next (2 years ago)

15 Versions

  • 0.14.3                                ...           2 years ago
  • 0.14.2                                ...           2 years ago
  • 0.14.1                                ...           2 years ago
  • 0.14.0                                ...           2 years ago
  • 0.13.0                                ...           2 years ago
  • 0.13.0-pre.1                                ...           2 years ago
  • 0.12.4                                ...           3 years ago
  • 0.12.3                                ...           3 years ago
  • 0.12.2                                ...           3 years ago
  • 0.12.1                                ...           3 years ago
  • 0.11.3                                ...           3 years ago
  • 0.12.0                                ...           3 years ago
  • 0.11.2                                ...           3 years ago
  • 0.11.1                                ...           3 years ago
  • 0.11.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 22
Last Day 0
Last Week 0
Last Month 6
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |