Skip to content

Commit

Permalink
Add .env.testing file
Browse files Browse the repository at this point in the history
  • Loading branch information
matiullah-karimi committed Dec 30, 2023
1 parent 85b11ea commit 76ddbe1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NODE_ENV=test
APP_NAME=app
DB_HOST=127.0.0.1
DB_PORT=27017
DB_NAME=
DB_USER=
DB_PASS=
APP_HOST=http:localhost:3000
APP_PORT=3000
JWT_SECRET=0Z396Ug1vXdxHqKaAhJSqrxgHLfY3xAwfvTKUcIEUKpvfSi12HvaOUoWVY92irrd
PER_PAGE=10
ADMIN_PASSWORD=secret
18 changes: 7 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ jobs:
test:
runs-on: ubuntu-latest

container:
image: node:10.16-jessie

services:
mongodb:
image: mongo
ports:
- 27017:27017

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -42,15 +33,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 14

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 4.4

- name: Install dependencies
run: npm install

- name: Install jest globally
run: npm i -g jest

- name: Copy .env.example content to .env
run: cp .env.example .env
- name: Copy .env.testing content to .env
run: cp .env.testing .env

- name: Run tests
run: npm run test

0 comments on commit 76ddbe1

Please sign in to comment.