Skip to content

Commit

Permalink
chore: Add unit tests and coverage report (#532)
Browse files Browse the repository at this point in the history
Signed-off-by: Yaroslav Markovski <[email protected]>
  • Loading branch information
yaroslav-007 authored Feb 15, 2024
1 parent d989fb9 commit d180d56
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,34 @@ jobs:
npm run test
- name: Stop the local node
run: npm run stop
run: npm run stop

unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [18.x]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test

- name: Upload coverage report
if: ${{ always() && !cancelled() }}
uses: codecov/codecov-action@v3

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,6 @@ network-logs/minio-server/data/**

### nyc cache
.nyc_output

### Codecov coverage report files directory
coverage
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,15 @@
"shelljs": "^0.8.5",
"ts-mocha": "^9.0.0",
"yargs": "^17.7.2"
},
"nyc": {
"check-coverage": false,
"reporter": [
"html",
"lcov",
"text",
"text-summary"
],
"report-dir": "coverage"
}
}

0 comments on commit d180d56

Please sign in to comment.