Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codecov integration for showing code coverage percentage #1

Merged
merged 8 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});

});
Loading