simplabs/ember-cli-code-coverage

Name: ember-cli-code-coverage

Owner: simplabs

Description: Code coverage for ember apps using Istanbul

Forked from: kategengler/ember-cli-code-coverage

Created: 2017-05-31 10:06:40.0

Updated: 2017-05-31 10:06:42.0

Pushed: 2017-05-31 10:40:23.0

Homepage: null

Size: 128

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ember-cli-code-coverage Build Status

Code coverage using Istanbul for Ember apps.

Requirements
Installation
Usage

Coverage will only be generated when an environment variable is true (by default COVERAGE) and running your test command like normal.

For example:

COVERAGE=true ember test

If you want your coverage to work on both Unix and Windows, you can do this:

npm install cross-env --save-dev

and then:

cross-env COVERAGE=true ember test

When running with parallel set to true, the final reports can be merged by using ember coverage-merge. The final merged output will be stored in the coverageFolder.

Configuration

Configuration is optional. It should be put in a file at config/coverage.js (configPath configuration in package.json is honored)

Options Example
dule.exports = {
coverageEnvVar: 'COV'

Create a passthrough when intercepting all ajax requests in tests

To work, this addon has to post coverage results back to a middleware at /write-coverage.

If you are using ember-cli-mirage you should add the following:

n mirage/config.js

is.passthrough('/write-coverage');
is.namespace = 'api';  // It's important that the passthrough for coverage is before the namespace, otherwise it will be prefixed.

If you are using ember-cli-pretender you should add the following:

here ever you set up the Pretender Server

r server = new Pretender(function () {
this.post('/write-coverage', this.passthrough);
;
Inspiration

This addon was inspired by ember-cli-blanket. The primary differences are that this addon uses Istanbul rather than Blanket for coverage and it instruments your application code as part of the build, when enabled.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.