{"id":13578397,"url":"https://github.com/stjohnjohnson/jenkins-mocha","last_synced_at":"2025-08-06T14:32:14.027Z","repository":{"id":19901485,"uuid":"23166687","full_name":"stjohnjohnson/jenkins-mocha","owner":"stjohnjohnson","description":"Bin wrapper for Mocha + Istanbul + Xunit (for Jenkins)","archived":false,"fork":false,"pushed_at":"2023-07-13T06:05:50.000Z","size":176,"stargazers_count":20,"open_issues_count":7,"forks_count":16,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-15T21:25:41.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/jenkins-mocha","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stjohnjohnson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-08-20T22:45:26.000Z","updated_at":"2023-06-29T03:45:32.000Z","dependencies_parsed_at":"2024-04-08T16:03:33.734Z","dependency_job_id":"b9f1a86a-42ec-485a-b436-46cae555eb1d","html_url":"https://github.com/stjohnjohnson/jenkins-mocha","commit_stats":{"total_commits":58,"total_committers":12,"mean_commits":4.833333333333333,"dds":0.603448275862069,"last_synced_commit":"2e6c2cebcea87db5bc6131488fa6e8f570baf173"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjohnjohnson%2Fjenkins-mocha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjohnjohnson%2Fjenkins-mocha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjohnjohnson%2Fjenkins-mocha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjohnjohnson%2Fjenkins-mocha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stjohnjohnson","download_url":"https://codeload.github.com/stjohnjohnson/jenkins-mocha/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228911877,"owners_count":17990774,"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","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-08-01T15:01:30.231Z","updated_at":"2024-12-09T15:18:35.342Z","avatar_url":"https://github.com/stjohnjohnson.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# jenkins-mocha\n\nSingle command to run your Mocha unit tests with both XUnit and LCov output (for Jenkins).\n\n[![Version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][status-image]][status-url] [![Open Issues][issues-image]][issues-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage][cov-image]][cov-url] [![Vulnerabilities][vul-image]][vul-url] ![License][license-image]\n\n## Installation\n\njenkins-mocha should be added to your test codebase as a dev dependency.  You can do this with:\n\n``` shell\n$ npm install --save-dev jenkins-mocha\n```\n\nAlternatively you can manually add it to your package.json file:\n\n``` json\n{\n  \"devDependencies\" : {\n    \"jenkins-mocha\": \"latest\"\n  }\n}\n```\n\nthen install with:\n\n``` shell\n$ npm install --dev\n```\n\n## Run\n\njenkins-mocha should replace your mocha command in npm test\n\n``` json\n{\n    \"scripts\": {\n        \"test\": \"jenkins-mocha test/*\"\n    }\n}\n```\n\nWith coverage on (the default), you can pass a `--cobertura` option to the command\nto have nyc use the cobertura reporter\n\n```json\n{\n    \"scripts\": {\n        \"devtest\": \"jenkins-mocha --cobertura test/*\"\n    }\n}\n```\n\nIf you want to turn coverage reporting off entirely, and just run unit tests with mocha,\nyou need to pass a `--no-coverage` option to the command\n\n```json\n{\n    \"scripts\": {\n        \"devtest\": \"jenkins-mocha --no-coverage test/*\"\n    }\n}\n```\n\nAny other parameters added to the command will be passed directly to mocha.\n\nIf you need to configure nyc, you may create a .nycrc configuration file. Run `nyc help config` for details.\n\nIf you want to configure how node is invoked (if you have a giant coverage file), you can set v8 arguments via `$(NODE_ARGS)`.\n\n``` json\n{\n    \"scripts\": {\n        \"test\": \"NODE_ARGS='--max_old_space_size=4096' jenkins-mocha test/*\"\n    }\n}\n```\n\nWhen npm-test is invoked, the module will:\n - Create XUnit test results in `$(TEST_DIR)`\n - Create LCov coverage in `$(COVERAGE_DIR)` with a HTML report at `$(COVERAGE_DIR)\\lcov-report`\n\nDefault values are:\n - `$(ARTIFACTS_DIR) = ./artifacts`\n - `$(TEST_DIR) = ./$(ARTIFACTS_DIR)/test`\n - `$(COVERAGE_DIR) = ./$(ARTIFACTS_DIR)/coverage`\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT) © [St. John Johnson](http://stjohnjohnson.com)\n\n[downloads-image]: https://img.shields.io/npm/dm/jenkins-mocha.svg\n[license-image]: https://img.shields.io/npm/l/jenkins-mocha.svg\n[npm-image]: https://img.shields.io/npm/v/jenkins-mocha.svg\n[npm-url]: https://npmjs.org/package/jenkins-mocha\n[cov-image]: https://coveralls.io/repos/github/stjohnjohnson/jenkins-mocha/badge.svg?branch=master\n[cov-url]: https://coveralls.io/github/stjohnjohnson/jenkins-mocha?branch=master\n[status-image]: https://cd.screwdriver.cd/pipelines/63/badge\n[status-url]: https://cd.screwdriver.cd/pipelines/63\n[vul-image]: https://snyk.io/test/github/stjohnjohnson/jenkins-mocha.git/badge.svg\n[vul-url]: https://snyk.io/test/github/stjohnjohnson/jenkins-mocha.git\n[issues-image]: https://img.shields.io/github/issues/stjohnjohnson/jenkins-mocha.svg\n[issues-url]: https://github.com/stjohnjohnson/jenkins-mocha/issues\n[daviddm-image]: https://david-dm.org/stjohnjohnson/jenkins-mocha.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/stjohnjohnson/jenkins-mocha\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstjohnjohnson%2Fjenkins-mocha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstjohnjohnson%2Fjenkins-mocha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstjohnjohnson%2Fjenkins-mocha/lists"}