FountainJS/generator-fountain-angular2

No code coverage from UT

Opened this issue · 4 comments

Description

I use the latest version of generator-fountain-angular2, I found you inject karma-coverage plugin, but there's no further configuration to generate code coverage report. As I know, to generate code coverage is not so easy specially when we use 'jspm' and 'typescript', so do you have plan to finish that part?

Error Message & Stack Trace

COPY THE ERROR MESSAGE, INCLUDING STACK TRACE HERE

Config

Copy the content from .yo-rc.json:

{
  "generator-fountain-angular2": {
    ...
  }
}

Relevant Links

  • If your project is public, link to the repo so we can investigate directly.
  • BONUS POINTS: Create a minimal reproduction and upload it to GitHub. This will get you the fastest support.

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and yo. Run the following to get it quickly:

node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
yo --version
npm --version
zckrs commented

Can you complete your issue with template?
We need more information like version node, npm, fountain generator to help you

Sure, my environment:

Node.js v6.6.0
win32 10.0.10586
yo 1.8.5
npm 3.10.3
foutain-generator (ts + jspm)

Swiip commented

We don't provide coverage for TS right now as we didn't find a good solution for it. But I recognize that this analysis is old, maybe, good solutions has appeared since?

Issue a year old. Running into this myself and commenting in hopes that you can revisit and find a solution now. This tool will be PERFECT for us if we have coverage.

I have this repo for your reference, created from the generator.

These guys have it figured out but that is a monster starter.

UPDATE

I got this to work here

All I did was add remap-coverage and threshold reporters and it now generates
a build fail if thresholds aren't met.

PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 7 of 7 SUCCESS (3.513 secs / 1.164 secs)

==================== Coverage / Threshold summary =============================
Statements   : 53.1% ( 24127/45441 ) Threshold : 50%
Branches     : 29.6% ( 4761/16082 ) Threshold : 50%
Functions    : 43.59% ( 5065/11619 ) Threshold : 50%
Lines        : 54.05% ( 22465/41562 ) Threshold : 50%
================================================================================
16 05 2017 09:37:11.727:ERROR [Threshold]: Failed minimum coverage threshold expectations