Skip to content

Commit 6499381

Browse files
committed
add coverage reports to PostgreSQL tests
1 parent 0a102c1 commit 6499381

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

.github/workflows/postgres-redis-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ jobs:
2626
env:
2727
TEST_POSTGRES: true
2828
timeout-minutes: 5
29-
run: npm test
29+
run: npx nyc --silent npm test
30+
- name: Generate coverage report
31+
run: npm run cover:report

.nycrc.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2+
"extends": "@istanbuljs/nyc-config-typescript",
3+
"check-coverage": false,
24
"exclude": [
3-
"src/routes/addUnlitedVideo.ts"
4-
]
5+
"src/routes/addUnlistedVideo.ts",
6+
"src/cronjob/downvoteSegmentArchiveJob.ts",
7+
"src/databases/*"
8+
],
9+
"reporter": ["text", "html"]
510
}

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "src/index.ts",
66
"scripts": {
77
"test": "npm run tsc && ts-node test/test.ts",
8-
"test:coverage": "nyc npm run test",
8+
"cover": "nyc npm test",
9+
"cover:report": "nyc report",
910
"dev": "nodemon",
1011
"dev:bash": "nodemon -x 'npm test ; npm start'",
1112
"postgres:docker": "docker run --rm -p 5432:5432 -e POSTGRES_USER=ci_db_user -e POSTGRES_PASSWORD=ci_db_pass postgres:alpine",
@@ -32,6 +33,7 @@
3233
"sync-mysql": "^3.0.1"
3334
},
3435
"devDependencies": {
36+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
3537
"@types/better-sqlite3": "^7.5.0",
3638
"@types/cron": "^2.0.0",
3739
"@types/express": "^4.17.13",

0 commit comments

Comments
 (0)