Run nyc to collect code coverage from hosted targets

vcastro
Participant I

Hi,

Is it possible to run nyc/istanbul (or any other tool) to collect the code coverage from nodejs hosted targets?

0 3 189
3 REPLIES 3

You can but why would you want to? Before you deploy anything, shouldn't you be testing these things on CI/CD environment, or at least your development environment? To answer your question, if you look at the HT Manifest File (app.yaml) Reference, you'll see there is a command property that you can set to something like "nyc --reporter=text --reporter=text-summary mocha tests/test-*.js && node ." Just know, this will only happen at deployment time and will not be done as part of saving your HT proxy.

@Jeremy Whitlock the reason is that i just want to collect code coverage from functional tests executed against a HT proxy deployed on my dev environment. but thanks a lot for the answer.

Hey Victor,

Based on a quick look at the istanbul/nyc github it looks like this is just a CLI code coverage tool. I don't see any reason why you couldn't run the cli locally against the hosted/ dir in your proxy bundle to get code coverage information.


Please let me know if I'm not understanding your question correcty.

Regards,

Josh