martysweet / cfn-lint

A CloudFormation JSON and YAML Validator
MIT License
162 stars 38 forks source link

Add code coverage reporting #83

Open martysweet opened 6 years ago

martysweet commented 6 years ago

Similar to https://raw.githubusercontent.com/CircleCI-Public/circleci-demo-javascript-express/master/.circleci/config.yml

martysweet commented 6 years ago

http://rundef.com/typescript-code-coverage-istanbul-nyc

akdor1154 commented 6 years ago

One note on this - most of the validator tests are written more like integration/functional tests, not unit tests - this is fine in general, but it does mean that they will artificially inflate your code coverage numbers (for example, code coverage would probably end up reporting full coverage of resourcesSpec.ts just from running validator.spec.ts on its own, because the stuff in resourcesSpec ends up executed in pretty much every test.)

There are a few approaches to this. For starters, I'd probably recommend splitting validator unit tests and functional tests into separate test suites, and then only recording code coverage for stuff that gets executed in the unit tests. After they are split, we can write more unit tests :) what fun!