Skip to content

Commit f591b46

Browse files
committed
--update: CI setup guide & yml files
1 parent 177175e commit f591b46

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

.coveralls.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
service_name: travis
2+
repo_token: P1M53gwEDbai0gQZeyCtaMWHF7Hk6i8NS

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ node_js:
44
after_success:
55
- npm install -D coveralls
66
- npm run coverage
7-
# - npm run coveralls
7+
- npm run coveralls

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The repo for the code lab session of JSLovers meet-up on 17th March 2019! :blush:
44
The repository contains both the tests using ~~`Mocha`~~<sup>\*</sup> and `Jest`, however I prefer Node.js testing using `Mocha` when it comes to `MongoDB` & `Mongoose`
55

6-
[![Build Status](https://travis-ci.org/ashokdey/nodejs-unit-testing.svg?branch=master)](https://travis-ci.org/ashokdey/nodejs-unit-testing)
6+
[![Build Status](https://travis-ci.org/ashokdey/nodejs-unit-testing.svg?branch=step-4-ci-cd)](https://travis-ci.org/ashokdey/nodejs-unit-testing) [![Coverage Status](https://coveralls.io/repos/github/ashokdey/nodejs-unit-testing/badge.svg?branch=master)](https://coveralls.io/github/ashokdey/nodejs-unit-testing?branch=master)
77

88
## Agenda
99

Setup-TravisCI.md renamed to Setup-For-CI.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ Let's get this repository set for TravisCI so that TravisCI can run the unit/int
44

55
## Steps
66

7+
### Setup CI using TravisCI
8+
79
- Create an account on [TravisCI.org](https://travis-ci.org)
810
- Add your GitHub project repository from TravisCI Dashboard
911
- In your local repo for the same project, add a new file, `.travis.yml` at the root of the project folder
1012
- Add the langauge for your project
1113
- You can also add the version of your language
1214
- You can also add `after success` tasks (What to so after all the tests are successful)
1315
- Like we want the code coverage report once all test cases are passed
16+
- Let's get the Badge 😍 (Don't forgot to choose the branch while checking for the badge)
1417
- Push the changes to GitHub
15-
- Let's get the Badge 😍
1618

17-
## Example `.travis.yml` file
19+
#### Example `.travis.yml` file
1820

1921
```yml
2022
language: node_js
@@ -25,3 +27,20 @@ after_success:
2527
- npm run coverage
2628
- npm run coveralls
2729
```
30+
31+
### Setup Coveralls for Code Coverage Badge
32+
33+
- Go to [Coveralls.io](https://coveralls.io/)
34+
- Add your GitHub project repo
35+
- Click on `Details`, you'll get your repo token
36+
- Scroll down further to get the Code Coverage Badge
37+
- Choose markdown and paste the code in `README.md` 😍
38+
- In your local project repo, create a `.coveralls.yml`
39+
- Push the changes to GitHub
40+
41+
#### Example `.coveralls.yml` file
42+
43+
```yml
44+
service_name: travis
45+
repo_token: your_token
46+
```

0 commit comments

Comments
 (0)