Registry / testing / ember-cli-nacho-coverage

ember-cli-nacho-coverage

JSON →
library1.0.2jsnpmunverified

Code coverage addon for Ember apps using Istanbul. Current version 1.0.2 (last release). Works with any transpiler. Supports Mocha, Mirage, Pretender. Configurable via ember-cli-build.js. Key differentiators: uses Istanbul instead of Blanket, instruments code during build, parallel testing support via ember-exam, and passthrough for Ajax interception. Requires Testem >=1.6.0 for Mocha, and appropriate versions of Mirage/Pretender.

npm install ember-cli-nacho-coverage
INSTALL
IMPORT
SIG · EMBER-CLI-NACHO-CO
E
ember-cli-nacho-coverage
testingjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
/* No import needed, addon configured in ember-cli-build.js */ module.exports = { coverageEnvVar: 'COV' };
Configuration is done via ember-cli-build.js, not via imports. The addon is used through environment variable COVERAGE.

Shows install, config, and usage of ember-cli-nacho-coverage with environment variable.

// Step 1: Install the addon // ember install ember-cli-nacho-coverage // Step 2: Configure in ember-cli-build.js (optional) module.exports = { coverageEnvVar: 'COVERAGE', reporters: ['lcov', 'html'], excludes: ['*/mirage/**/*'], coverageFolder: 'coverage', parallel: false }; // Step 3: Run tests with coverage enabled // COVERAGE=true ember test // For parallel testing: // ember exam --parallel // ember coverage-merge
Debug
Known issues
gotchaWhen using Mirage or Pretender, you must set up a passthrough for /write-coverage. The passthrough must appear before the namespace setup in Mirage config.
fix
In mirage/config.js: this.passthrough('/write-coverage'); before setting namespace.
affects: >=0.0.0
gotchaIf using Mocha, Testem must be >=1.6.0 and ember-cli >2.4.3.
fix
Upgrade Testem and ember-cli as needed.
affects: >=0.0.0
gotchaThe json-summary reporter is always added regardless of configuration. Do not remove it.
fix
Just include other reporters; json-summary is automatic.
affects: >=0.0.0
gotchaParallel testing requires using ember coverage-merge after tests to combine reports.
fix
Run 'ember coverage-merge' after parallel tests.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Could not find module `ember-cli-nacho-coverage`
Missing addon installation or version incompatibility.
fix
Run 'ember install ember-cli-nacho-coverage' again.
TypeError: Cannot read property 'passthrough' of undefined
Mirage passthrough not configured correctly.
fix
Add this.passthrough('/write-coverage') in mirage/config.js before setting namespace.
Coverage report not generated even with COVERAGE=true
Environment variable not properly set or test framework incompatibility.
fix
Ensure COVERAGE=true is set before running ember test. Check Testem version.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
istanbulrequiredCore coverage engine
Agent activity
2 hits · last 30 days
node
2
Resources
ember-cli-nacho-coverage — npm install ember-cli-nacho-coverage · libregistry