Build a Modern JS Project - #11 Travis CI & Coveralls

Опубликовано: 22 Февраль 2019
на канале: Code Realm
11,548
199

In this video, we'll walk through setting up a build pipeline with Travis CI and collecting coverage reports from our unit tests using Coveralls. Be sure to check out the CI/CD basics video first    • Build a Modern JS Project - #2 What i...   to get on board.

Travis CI runs your jobs in phases, including install (to install the dependencies), script (to build the source), and deploy (to optionally deploy to a host), in that order. In a Node.js project, Travis CI by default will execute a clean install (as long as package-lock.json is present) with npm ci https://docs.npmjs.com/cli/ci.html This will read directly from package-lock.json and halt in case of any mismatch with package.json. Then, Travis will run npm test, unless otherwise specified in .travis.yml file.

Once we configure the YML file, we'll move on to Coveralls. Jest already provides a way to generate coverage reports, and we only need to collect and upload them using node-coveralls https://www.npmjs.com/package/coveralls We'll overwrite the default build script to first lint the codebase to make sure we're up to par with the coding style, and then run the test suite and generate the coverage.

As soon as you commit the config file, assuming you've signed up for both Travis and Coveralls, you should see your first build. Once it passes, the coverage should be up on Coveralls. To top it off, we'll add badges for both in our Readme.

Getting started with CI/CD https://docs.travis-ci.com/user/for-b...

Hands-on tutorial with Travis https://github.com/dwyl/learn-travis

Code coverage in 5 minutes https://zach.codes/ci-code-coverage-t...


Смотрите видео Build a Modern JS Project - #11 Travis CI & Coveralls онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Realm 22 Февраль 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 11,548 раз и оно понравилось 199 людям.