CI Code Coverage + Tests in 5 Minutes!
Building open source software can be lots of fun. For some reason, it brings me way too much joy seeing code coverage and tests run on every push to github. It doesn't need to be hard to setup; I'm going to show you how to add automated testing and code coverage reporting to your apps and libraries for every push, pull request, and merge! Here's what we need to get started:
Jest
Jest is the best test runner out there right now. It may not be the absolute fastest, but it has the easiest and most useful features that you're going to need. If you use mocha, you'll end up installing istanbul or something else that will run coverage. You want snapshot testing? Jest has that built in too.
Coveralls
Coveralls is a free service for open source projects that will store your coverage report and give you a badge to add in your repo with the latest stats! We'll use node-coveralls to handle sending it over.
CircleCI
I use circleci for automated builds, it's free for open source as well. This will trigge…
Keep reading with a 7-day free trial
Subscribe to zach.codes to keep reading this post and get 7 days of free access to the full post archives.