Skip to content

Commit

Permalink
ci: create workflow to test
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoCamargo31 committed Oct 26, 2023
1 parent 609b6e9 commit 5264a21
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Dependencies
run: npm install
- name: Run tests
run: |
cp .env.example .env
npm run test:ci
7 changes: 4 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module.exports = {
roots: ['<rootDir>/src'],
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
collectCoverageFrom: [
'<rootDir>/src/**/*.ts'
],
testTimeout: 60000,
coverageDirectory: 'coverage',
testEnvironment: 'node',
transform: {
'.+\\.ts$': 'ts-jest'
},
preset: '@shelf/jest-mongodb'
}
}
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
"build": "npx tsc --skipLibCheck --project ./",
"test": "jest --passWithNoTests --runInBand",
"test:unit": "npm test -- --watchAll -c jest-unit.config.js",
"test:ci": "npm test -- --coverage --forceExit"
"test:ci": "npm test -- -c jest-unit.config.js --coverage --forceExit"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@shelf/jest-mongodb": "^1.3.4",
"@types/express": "^4.17.18",
"@types/jest": "^29.2.3",
"@types/mongodb": "^3.6.9",
"@types/uuid": "^9.0.5",
"@types/uuid": "^9.0.6",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-standard-with-typescript": "^21.0.1",
Expand Down
15 changes: 0 additions & 15 deletions src/main.ts

This file was deleted.

0 comments on commit 5264a21

Please sign in to comment.