Getting Started Coveralls - ChoDragon9/posts GitHub Wiki

Getting Started

Coveralls ์„ค์ •

  1. https://coveralls.io/์—์„œ GitHub ๊ณ„์ • ์—ฐ๋™
  2. https://coveralls.io/repos/new์—์„œ ์ปค๋ฒ„๋ฆฌ์ง€ ๋ฆฌํฌํŠธ๋ฅผ ๋ฐ›์„ ์ €์žฅ์†Œ ํ™œ์„ฑํ™”

ํ…Œ์Šคํฌ ๋ช…๋ น์–ด ์„ค์ •

  1. node-coveralls ์„ค์น˜, npm i node-coveralls -D
  2. ํ…Œ์ŠคํŠธ ๋ช…๋ น์–ด์— coveralls ์—ฐ๋™
// package.json
"scripts": {
  "test": "jest --coverage --coverageReporters=text-lcov | coveralls"
}

Travis CI ์—ฐ๋™

node-coveralls์—์„œ ์‚ฌ์šฉํ•  ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ Travis CI์— ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  1. COVERALLS_SERVICE_NAME ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ถ”๊ฐ€, ๊ฐ’์€ travis-ci๋กœ ์„ค์ •
  2. COVERALLS_REPO_TOKEN ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ถ”๊ฐ€
    • coveralls์—์„œ ํ™œ์„ฑํ™”ํ•œ ์ €์žฅ์†Œ์˜ Repo Token์„ ๊ฐ’์œผ๋กœ ์„ค์ •

๋ฆฌํฌํŠธ ๋ฐ›๊ธฐ

  1. ๋นŒ๋“œ ๋ช…๋ น์–ด์— ์ปค๋ฒ„๋ฆฌ์ง€ ๋ช…๋ น์–ด ํฌํ•จ
"scripts": {
-  "build": "webpack"
+  "build": "webpack && npm run test"
}
  1. Travis CI์—์„œ ๋นŒ๋“œ ๋ช…๋ น์–ด ์‹คํ–‰
  2. ๋นŒ๋“œ ์™„๋ฃŒ ์‹œ ๋นŒ๋“œ ๊ฒฐ๊ณผ๊ฐ€ Coveralls์— ์ „๋‹ฌ๋จ
  3. coveralls.io ์ ‘์† ์‹œ Coverage ๊ฒฐ๊ณผ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Œ