generator-fountain-angular2 icon indicating copy to clipboard operation
generator-fountain-angular2 copied to clipboard

No code coverage from UT

Open chendachao opened this issue 9 years ago • 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

chendachao avatar Sep 24 '16 12:09 chendachao

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

zckrs avatar Sep 24 '16 13:09 zckrs

Sure, my environment:

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

chendachao avatar Oct 12 '16 01:10 chendachao

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?

Swiip avatar Nov 05 '16 09:11 Swiip

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

flacito avatar May 16 '17 12:05 flacito