{"id":20920129,"url":"https://github.com/mageddo/mocha-sonar-generic-test-coverage","last_synced_at":"2025-08-21T15:12:11.762Z","repository":{"id":57299921,"uuid":"48633981","full_name":"mageddo/mocha-sonar-generic-test-coverage","owner":"mageddo","description":null,"archived":false,"fork":false,"pushed_at":"2017-07-16T03:37:52.000Z","size":38,"stargazers_count":1,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T17:45:06.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mageddo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-27T05:24:30.000Z","updated_at":"2020-12-26T13:39:47.000Z","dependencies_parsed_at":"2022-09-01T13:11:02.524Z","dependency_job_id":null,"html_url":"https://github.com/mageddo/mocha-sonar-generic-test-coverage","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mageddo/mocha-sonar-generic-test-coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mageddo%2Fmocha-sonar-generic-test-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mageddo%2Fmocha-sonar-generic-test-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mageddo%2Fmocha-sonar-generic-test-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mageddo%2Fmocha-sonar-generic-test-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mageddo","download_url":"https://codeload.github.com/mageddo/mocha-sonar-generic-test-coverage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mageddo%2Fmocha-sonar-generic-test-coverage/sbom","scorecard":{"id":611424,"data":{"date":"2025-08-11","repo":{"name":"github.com/mageddo/mocha-sonar-generic-test-coverage","commit":"992ae8cbfdfd072eb9814357524c93430231b186"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 2/14 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: demo/Dockerfile:1: pin your Docker image by updating sonarqube:6.3.1-alpine to sonarqube:6.3.1-alpine@sha256:267ee0d18a74821a9671b3937cf5ec405d7ecc94a3efb0018b26c6abe74f9e39","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T02:45:26.082Z","repository_id":57299921,"created_at":"2025-08-21T02:45:26.082Z","updated_at":"2025-08-21T02:45:26.082Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271500267,"owners_count":24770371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T18:08:52.291Z","updated_at":"2025-08-21T15:12:11.721Z","avatar_url":"https://github.com/mageddo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\nThis is a mocha reporter project to integrate mocha unit tests to [sonar Generic Test coverage unit tests execution results](http://docs.sonarqube.org/display/PLUG/Generic+Test+Coverage#GenericTestCoverage-UnitTestsExecutionResultsReportFormat)\n\nThis reporter is only for unit test sucess/failures verification, to unit test line coverage take a look on [istanbul reporter](https://www.npmjs.com/package/grunt-istanbul)\n\n# Installation\n\n\tnpm install mocha-sonar-generic-test-coverage --save-dev\n\nOn pure mocha \n\n\tmocha --reporter mocha-sonar-generic-test-coverage testFolder\n\nOn **mocha-test** for use with grunt\n\n```javascript\nmochaTest: {\n\tcoverage: {\n\t\toptions: {\n\t\t\treporter: 'mocha-sonar-generic-test-coverage',\n\t\t\tquiet: false,\n\t\t\tcaptureFile: null, // default mocha test capture file variable\n\t\t\treporterOptions: {\n\t\t\t\toutputFile: null, // relative path file to capture instead append to captureFile (this file will not get prints at stdout) \n\t\t\t\tuseFileFullPath: false // generate report for the files using fullpath\n\t\t\t}\n\t\t}\n\t\t},\n\t\tsrc: [\n\t\t\t'test.js'\n\t\t]\n\t}\n}\n```\n\n# Testing\n\n\t$ npm install \u0026\u0026 npm test\n\n# Report demo sample\n\n\t$ npm install \u0026\u0026 \\\n\tcd demo \u0026\u0026 \\\n\tnpm install \u0026\u0026 \\\n\tnpm start\n\n\tRunning \"mochaTest:test\" (mochaTest) task\n\tWarning: Task \"mochaTest:test\" failed. Used --force, continuing.\n\tDone, but with warnings.\n\nThere is one test with error intencionally for metrics at sonar\n\nRunning sonarscanner\n\n\t$ docker run -p9000:9000 --name sonarqube -v $PWD:/app defreitas/sonarqube:6.3.1-alpine\n\nReporting to sonarqube\n\n\t$ docker exec -it sonarqube sh -c 'cd /app \u0026\u0026 sonar-scanner'\n\nThen [open your browser](http://127.0.0.1:9000/component_measures/metric/tests/list?id=mocha-sonar-generic-test-coverage-demo) and see the test report results \n\n# Output example \n\n```xml\n\u003cunitTest version=\"1\"\u003e\n\t\u003cfile path=\"src/main/java/com/example/MyClass.java\"\u003e\n\t\t\u003ctestCase name=\"test1\" duration=\"500\"/\u003e\n\t\t\u003ctestCase name=\"test2\" duration=\"600\"/\u003e\n\t\t\u003ctestCase name=\"test3\" duration=\"600\"\u003e\n\t\t\t\u003cfailure message=\"sort message\"\u003elong stacktrace\u003c/failure\u003e\n\t\t\u003c/testCase\u003e\n\t\t\u003ctestCase name=\"test4\" duration=\"600\"\u003e\n\t\t\t\u003cerror message=\"sort message\"\u003elong stacktrace\u003c/error\u003e\n\t\t\u003c/testCase\u003e\n\t\t\u003ctestCase name=\"test5\" duration=\"600\"\u003e\n\t\t\t\u003cskipped message=\"sort message\"\u003elong stacktrace\u003c/skipped\u003e\n\t\t\u003c/testCase\u003e\n\t\u003c/file\u003e\n\u003c/unitTest\u003e\n```\n\nSonar preview\n\n![](http://i.imgur.com/mlxAPI1.jpg)\n![](http://i.imgur.com/n9eCbt7.jpg)\n![](http://i.imgur.com/Bfw0amn.jpg)\n\n\n# Release Notes\n* `0.0.6` backing mstc support\n* `0.0.4` `mstc` variable was migrated to `reporterOptions`, anyway `mstc` it's supported yet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmageddo%2Fmocha-sonar-generic-test-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmageddo%2Fmocha-sonar-generic-test-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmageddo%2Fmocha-sonar-generic-test-coverage/lists"}