Skip to content

Commit

Permalink
Merge pull request #1 from lwinmoehein/development
Browse files Browse the repository at this point in the history
Add codecov integration  for showing code coverage percentage
  • Loading branch information
lwinmoehein committed Nov 7, 2023
2 parents cd4b903 + 53e11ec commit 4b782a9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Running Code Coverage

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN}}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[![npm version](https://img.shields.io/npm/v/mm-mobile-tools.svg?style=flat-square)](https://www.npmjs.org/package/mm-mobile-tools)
![Build status](https://github.com/lwinmoehein/MM-Mobiile-Tools-JS/actions/workflows/cd.yml/badge.svg)
[![code coverage](https://img.shields.io/coveralls/mzabriskie/mm-mobile-tools.svg?style=flat-square)](https://coveralls.io/r/lwinmoehein/mm-mobile-tools)
[![codecov](https://codecov.io/gh/lwinmoehein/MM-Mobile-Tools-JS/graph/badge.svg?token=YVS9A98YJQ)](https://codecov.io/gh/lwinmoehein/MM-Mobile-Tools-JS)
[![npm downloads](https://img.shields.io/npm/dm/mm-mobile-tools.svg?style=flat-square)](https://npm-stat.com/charts.html?package=mm-mobile-tools)

</div>
Expand Down
4 changes: 4 additions & 0 deletions __tests__/GetOperator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ describe('Phone Number validation checks', () => {
test('Should return true for valid MECTel phone number', () => {
expect(mmphone.getOperator("09301173991")).toBe(Operator.MECTEL);
});
test('Should return true for invalid phone number', () => {
expect(mmphone.getOperator("0911223344881")).toBe(Operator.INVALID);
});

});

0 comments on commit 4b782a9

Please sign in to comment.