Skip to content

Commit

Permalink
[finishes 187511688]-implement-badges-status(CI/CD)-show-whether-pass…
Browse files Browse the repository at this point in the history
…ed-or-failed
  • Loading branch information
hozayves committed May 2, 2024
1 parent 512caa3 commit c92d5b3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ CLOUDINARY_SECRET=""

#USER ADMIN CREDENTIALS
ADMIN_PASSWORD=""
ADMIN_PHONE=""
ADMIN_PHONE=""
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
DB_USER: ${{ secrets.DEV_DB_USER }}
DB_PASSWORD: ${{ secrets.DEV_DB_PASSWORD }}
DB_HOST: ${{ secrets.DEV_DB_HOST }}
- name: Send Coverage to Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}

build:
name: Build
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
[![.github/workflows/main.yaml](https://github.com/atlp-rwanda/e-commerce-mavericcks-bn/actions/workflows/main.yaml/badge.svg)](https://github.com/atlp-rwanda/e-commerce-mavericcks-bn/actions/workflows/main.yaml)
[![Coverage Status](https://coveralls.io/repos/github/atlp-rwanda/e-commerce-mavericcks-bn/badge.svg?branch=develop)](https://coveralls.io/github/atlp-rwanda/e-commerce-mavericcks-bn?branch=develop) [![Version](https://img.shields.io/badge/version-1.0.0-blue)](https://github.com/your-username/your-repo-name/releases/tag/v1.0.0) ![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/atlp-rwanda/e-commerce-mavericcks-bn) [![Test Coverage](https://api.codeclimate.com/v1/badges/c73dab3934e9b2672420/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-mavericcks-bn/test_coverage)



<a href="https://nodejs.org/en">![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)</a> <a href="https://expressjs.com/">![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)</a> <a href="https://sequelize.org/">![Static Badge](https://img.shields.io/badge/Sequelize-blue?style=for-the-badge&logo=nodedotjs&logoColor=white)</a> <a href="https://www.docker.com/">![Static Badge](https://img.shields.io/badge/Docker-%23095CB0?style=for-the-badge&logo=docker&logoColor=white)</a> <a href="https://www.typescriptlang.org/">![Static Badge](https://img.shields.io/badge/Typescript-%234A5561?style=for-the-badge&logo=typescript&logoColor=white)</a> <a href="https://www.passportjs.org/">![Static Badge](https://img.shields.io/badge/Passport-%2372A98A?style=for-the-badge&logo=passport&logoSize=amg)</a> <a href="https://e-commerce-mavericcks-bn-staging-istf.onrender.com/api/docs/">![Swagger](https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge&logo=swagger&logoColor=white)</a>









# e-commerce-mavericcks-bn

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dev": "cross-env NODE_ENV=development nodemon src/server.ts",
"start": "cross-env NODE_ENV=production node dist/src/server.js",
"test": "cross-env NODE_ENV=test jest --coverage",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"lint": "eslint --ignore-path .eslintignore \"**/*.{js,ts}\"",
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
"prepare": "husky install && npx husky add .husky/pre-commit \"npx lint-staged\"",
Expand Down Expand Up @@ -69,6 +70,7 @@
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"babel-jest": "^29.7.0",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/testController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function addition(a: number, b: number) {
return a + b;
}
18 changes: 18 additions & 0 deletions src/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
import { addition } from '../controllers/testController';

test('Adding 2 and 1 equals 3', () => {
expect(2 + 1).toBe(3);
});
test('Addition function adds two numbers correctly', () => {
// Test case 1: Testing addition of positive numbers
expect(addition(2, 3)).toBe(5); // Expected result: 2 + 3 = 5

// Test case 2: Testing addition of negative numbers
expect(addition(-2, -3)).toBe(-5); // Expected result: -2 + (-3) = -5

// Test case 3: Testing addition of a positive and a negative number
expect(addition(5, -3)).toBe(2); // Expected result: 5 + (-3) = 2

// Test case 4: Testing addition of zero and a number
expect(addition(0, 7)).toBe(7); // Expected result: 0 + 7 = 7

// Test case 5: Testing addition of a number and zero
expect(addition(4, 0)).toBe(4); // Expected result: 4 + 0 = 4
});

0 comments on commit c92d5b3

Please sign in to comment.