Skip to content

Commit 7301fcf

Browse files
committed
chore(api): enhance Jest coverage reporting and add junit support
1 parent 59d088e commit 7301fcf

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

.github/workflows/api_pr_coverage_report.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ jobs:
1818
run: npm ci
1919

2020
- name: Run Jest Tests with Coverage
21-
run: npm run test:cov
21+
run: npm run test:cov | tee ./coverage/coverage.txt
2222
working-directory: modules/services/api/
2323

2424
- name: Jest Coverage Comment
2525
uses: MishaKav/jest-coverage-comment@main
2626
with:
2727
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
coverage-path: ./modules/services/api/coverage/coverage.txt
2829
coverage-summary-path: ./modules/services/api/coverage/coverage-summary.json
30+
junitxml-path: ./modules/services/api/coverage/junit.xml

modules/services/api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"class-transformer": "^0.5.1",
3535
"class-validator": "^0.14.1",
3636
"ioredis": "^5.4.2",
37+
"jest-junit": "^16.0.0",
3738
"pg": "^8.13.1",
3839
"reflect-metadata": "^0.1.14",
3940
"rxjs": "^7.8.1",

modules/services/api/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ async function bootstrap() {
2222
.build();
2323
const documentFactory = () => SwaggerModule.createDocument(app, config);
2424
SwaggerModule.setup('swagger', app, documentFactory);
25-
2625
useContainer(app.select(AppModule), { fallbackOnErrors: true });
27-
2826
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
2927

3028
// TODO Change environment variable to VIDYA_PORT

package-lock.json

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

0 commit comments

Comments
 (0)