Skip to content

Commit

Permalink
test: Reconfigure test coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukli committed Mar 9, 2024
1 parent c521af9 commit c966729
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ jobs:
- name: Run unit tests
run: npm test

- name: Run code coverage instrumented CLI
run: |-
npx nyc instrument "dist/" "inst/"
npx nyc npx montehall --verbose
- name: Generate combined code coverage report
run: |-
cp "test-out/coverage/coverage-final.json" ".nyc_output/unit-test-coverage.json"
npx nyc report
- name: Analyze with SonarCloud
if: ${{ matrix.node-version.run-sonarscanner }}
uses: SonarSource/sonarcloud-github-action@master
Expand Down
2 changes: 1 addition & 1 deletion .nycrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"all": false,
"extension": [".js", ".mjs"],
"extends": "@istanbuljs/nyc-config-typescript",
"reporter": ["json", "lcov", "text"]
}
20 changes: 18 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "montehall",
"version": "1.5.0",
"version": "1.5.1",
"description": "A Monte Carlo machine for the Monty Hall Problem",
"author": "Omar Boukli-Hacene",
"license": "MIT",
Expand All @@ -20,16 +20,17 @@
"node": ">=16.20.2"
},
"scripts": {
"prelint": "tsc --project tsconfig.spec.json",
"lint": "eslint . --ext .mts,.ts",
"build": "tsc",
"pretest": "tsc --project tsconfig.spec.json",
"test": "jest --config=test-out/jest.config.cjs"
"test": "jest --config=test-out/jest.config.cjs",
"prelint": "npm run pretest",
"lint": "eslint '.' --ext .mts,.ts"
},
"dependencies": {
"commander": "^11.1.0"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@jest/globals": "^29.7.0",
"@types/node": "^20.11.25",
"@typescript-eslint/eslint-plugin": "^7.1.1",
Expand All @@ -49,7 +50,6 @@
"files": [
".nvmrc",
"CITATION.cff",
"config.json",
"dist/**/*.*"
],
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sonar.scm.enabled=true
sonar.scm.provider=git
sonar.sourceEncoding=UTF-8
sonar.cpd.exclusions=**/*.spec.ts
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar.javascript.lcov.reportPaths=./test-out/coverage/lcov.info
2 changes: 1 addition & 1 deletion src/app-params.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: MIT
export const appParams = {
name: "montehall",
description: "Montehall: A Monte Carlo Machine for the Monty Hall Problem",
version: "1.5.0",
version: "1.5.1",
numGamesToSimulate: 16384,
numbersFilePath: "./data/numbers.txt",
};

0 comments on commit c966729

Please sign in to comment.