Skip to content

Commit

Permalink
Merge pull request #22 from atlp-rwanda/feat-logout-functionality-187…
Browse files Browse the repository at this point in the history
…419054

#187419054 handle logout functionality
  • Loading branch information
leandreAlly authored Apr 25, 2024
2 parents 2017f42 + fec37c8 commit 40e9cba
Show file tree
Hide file tree
Showing 20 changed files with 701 additions and 559 deletions.
133 changes: 65 additions & 68 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,65 @@
name: build

on:
push:
branches:
- develop
- "*"
pull_request:
branches:
- develop
- "*"

jobs:
test:
runs-on: ubuntu-latest

env:
DB_TEST_URL: ${{ secrets.DB_TEST_URL }}
DEV_MODE: ${{ secrets.DEV_MODE }}
DB_HOSTED_MODE: ${{ secrets.DB_HOSTED_MODE }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

strategy:
matrix:
node-version: ["20.x"]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

- name: Run tests and build test coverage
run: npm run test:ci

- name: Setup Code Climate test-reporter
run: |
# Download test reporter as a static binary
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run tests
run: npm run test

- name: Store coverage report
if: always()
run: mkdir -p coverage


- name: Send coverage report to Code Climate
if: always()
run: ./cc-test-reporter after-build -t lcov -p coverage

- name: coveralls
run: npx coveralls < coverage/lcov.info


name: build

on:
push:
branches:
- develop
- "*"
pull_request:
branches:
- develop
- "*"

jobs:
test:
runs-on: ubuntu-latest

env:
DB_TEST_URL: ${{ secrets.DB_TEST_URL }}
DEV_MODE: ${{ secrets.DEV_MODE }}
DB_HOSTED_MODE: ${{ secrets.DB_HOSTED_MODE }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

strategy:
matrix:
node-version: ["20.x"]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

- name: Run tests and build test coverage
run: npm run test:ci

- name: Setup Code Climate test-reporter
run: |
# Download test reporter as a static binary
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run tests
run: npm run test

- name: Store coverage report
if: always()
run: mkdir -p coverage

- name: Send coverage report to Code Climate
if: always()
run: ./cc-test-reporter after-build -t lcov -p coverage

- name: coveralls
run: npx coveralls < coverage/lcov.info
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@
Welcome to <b>ShopTrove</b>, an Excellent E-commerce destination! Browse thousands of products from top brands, enjoy exclusive deals, and personalized recommendations. With secure payments and fast delivery, ShopTrove makes shopping a breeze. <br><br> This READMe file explains in detail how our app works and how to run it in your local development environment.

## Stack development

[![Development stacks](https://skillicons.dev/icons?i=typescript,express,nodejs,jest&theme=light)](https://skillicons.dev)

## Database, ORM and data storage

[![Database, ORM and data storage](https://skillicons.dev/icons?i=postgres,sequelize&theme=light)](https://skillicons.dev)

## Continuous integration

[![Continuous integration](https://skillicons.dev/icons?i=githubactions&theme=light)](https://skillicons.dev)

## Version control

[![Version control](https://skillicons.dev/icons?i=github,git&theme=light)](https://skillicons.dev)

## API documentation
<a href="https://hackers-ec-be.onrender.com/api/v1/docs/">![Swagger](https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge&logo=swagger&logoColor=white)</a>

<a href="https://hackers-ec-be.onrender.com/api/v1/docs/">![Swagger](https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge&logo=swagger&logoColor=white)</a>
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-session": "^1.18.0",
"joi": "^17.12.3",
"jsonwebtoken": "^9.0.2",
"passport": "^0.5.0",
"joi": "^17.12.3",
"passport-local": "^1.0.0",
"passport-stub": "^1.1.1",
"pg": "^8.11.5",
Expand All @@ -55,37 +55,37 @@
"/src/database/config/db.config.ts"
]
},

"devDependencies": {
"@types/bcrypt": "^5.0.2",
"@eslint/js": "^9.0.0",
"@types/eslint": "^8.56.9",
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/jest": "^29.5.12",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^20.12.7",
"@types/passport": "^1.0.16",
"@types/passport-local": "^1.0.38",
"@types/pg": "^8.11.5",
"passport-stub": "^1.1.1",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"devDependencies": {
"@eslint/js": "^9.0.0",
"@types/bcrypt": "^5.0.2",
"@types/eslint": "^8.56.9",
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/jest": "^29.5.12",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^20.12.7",
"@types/passport": "^1.0.16",
"@types/passport-local": "^1.0.38",
"@types/pg": "^8.11.5",
"@types/supertest": "^6.0.2",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.2",
"passport-stub": "^1.1.1",
"prettier": "3.2.5",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.0",
"@types/supertest": "^6.0.2",
"dotenv": "^16.4.5",
"jest": "^29.7.0",
"sequelize-cli": "^6.6.2",
"supertest": "^6.3.4",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
Expand Down
12 changes: 6 additions & 6 deletions src/__test__/product.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import request from "supertest";
jest.setTimeout(30000);

describe("PRODUCT API TEST", () => {
// beforeAll(async () => {
// await connectionToDatabase();
// });
// beforeAll(async () => {
// await connectionToDatabase();
// });

it("Seller should create a product", async () => {
// Your test implementation goes here
});
it("Seller should create a product", async () => {
// Your test implementation goes here
});
});
Loading

0 comments on commit 40e9cba

Please sign in to comment.