Skip to content

Commit a3932f7

Browse files
feat(tests): add coverage reporting and update test command
1 parent efccfd5 commit a3932f7

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/sonar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- run: npm ci
2323

24-
- run: npm test
24+
- run: npm run test:coverage
2525

2626
- uses: SonarSource/sonarqube-scan-action@v6
2727
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ npm-debug.log*
1616

1717
# Logs
1818
*.log
19+
20+
# Coverage
21+
lcov.info

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"scripts": {
3939
"test": "node --test",
40+
"test:coverage": "node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info",
4041
"lint": "eslint .",
4142
"lint:fix": "eslint . --fix",
4243
"format": "prettier --write .",

sonar-project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ sonar.projectKey=mahmudunnabikajal_niftycli
33
sonar.sources=bin,src
44
sonar.tests=test
55
sonar.exclusions=docs/**
6+
sonar.javascript.lcov.reportPaths=lcov.info

0 commit comments

Comments
 (0)