Skip to content

Commit

Permalink
fix: Fix test coverage reports (#27)
Browse files Browse the repository at this point in the history
* Fix test coverage reports

* Add missing coverage report output

* Simplify test runs

* Change coverage reporter to c8
  • Loading branch information
gpmayorga authored Dec 4, 2024
1 parent 6c8d1ef commit dbe1cc7
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 906 deletions.
8 changes: 8 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"all": true,
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.d.ts", "src/**/*.test.ts", "src/types/*.ts", "src/tests/**/*.ts"],
"reporter": ["text", "lcov"],
"extension": [".ts"],
"report-dir": "./coverage"
}
7 changes: 3 additions & 4 deletions .github/workflows/build-test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
run: yarn build

- name: Run tests
run: |
yarn test:ci
yarn test:coverage
run: yarn test:coverage
env:
TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }}
PROJECT_SLUG: ${{ secrets.PROJECT_SLUG }}
Expand All @@ -50,6 +48,7 @@ jobs:
name: test-results
path: |
report/
coverage/lcov-report/
retention-days: 15

- name: Upload coverage to Codecov
Expand All @@ -58,5 +57,5 @@ jobs:
directory: ./coverage
token: ${{ secrets.CODECOV_TOKEN }}
# flags: unittests
name: sdk-coverage-with-nyc
name: sdk-coverage
fail_ci_if_error: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ yarn-error.log
# Tests and coverage
coverage/
test-results.xml
.nyc_output
report/
7 changes: 0 additions & 7 deletions .nycrc

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test:simple:single": "mocha --loader=ts-node/esm --exit --timeout 60000",
"test:single": "mocha --loader=ts-node/esm --require $(pwd)/src/tests/setup.ts --exit --timeout 60000",
"test:ci": "yarn test --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.json",
"test:coverage": "nyc yarn test"
"test:coverage": "c8 yarn test:ci"
},
"dependencies": {
"decimal.js-light": "^2.5.1",
Expand All @@ -47,6 +47,7 @@
"@types/node": "^22.7.8",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^4",
"c8": "^10.1.2",
"chai": "^5.1.2",
"dotenv": "^16.4.5",
"eslint": "^9.12.0",
Expand All @@ -55,7 +56,6 @@
"mocha-multi-reporters": "^1.5.1",
"mochawesome": "^7.1.3",
"npm-run-all": "4.1.5",
"nyc": "^17.1.0",
"prettier": "^3.3.3",
"sinon": "^19.0.2",
"sinon-chai": "^4.0.0",
Expand Down
Loading

0 comments on commit dbe1cc7

Please sign in to comment.