{"id":22324588,"url":"https://github.com/litixsoft/karma-mocha-reporter","last_synced_at":"2025-05-15T23:03:55.304Z","repository":{"id":12430593,"uuid":"15086591","full_name":"litixsoft/karma-mocha-reporter","owner":"litixsoft","description":"Karma reporter plugin with mocha style logging.","archived":false,"fork":false,"pushed_at":"2021-12-15T12:12:22.000Z","size":1154,"stargazers_count":197,"open_issues_count":14,"forks_count":45,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-19T02:35:24.399Z","etag":null,"topics":["javascript","karma","karma-plugin","karma-reporter","mocha-style"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litixsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-10T19:09:18.000Z","updated_at":"2024-05-02T15:35:06.000Z","dependencies_parsed_at":"2022-08-30T15:52:54.208Z","dependency_job_id":null,"html_url":"https://github.com/litixsoft/karma-mocha-reporter","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litixsoft%2Fkarma-mocha-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litixsoft%2Fkarma-mocha-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litixsoft%2Fkarma-mocha-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litixsoft%2Fkarma-mocha-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litixsoft","download_url":"https://codeload.github.com/litixsoft/karma-mocha-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436944,"owners_count":22070946,"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":["javascript","karma","karma-plugin","karma-reporter","mocha-style"],"created_at":"2024-12-04T02:07:55.049Z","updated_at":"2025-05-15T23:03:55.204Z","avatar_url":"https://github.com/litixsoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# karma-mocha-reporter\n\n\u003e Karma reporter plugin with mocha style logging.\n\n\u003e [![NPM version](https://badge.fury.io/js/karma-mocha-reporter.svg)](http://badge.fury.io/js/karma-mocha-reporter)\n[![Build Status](https://secure.travis-ci.org/litixsoft/karma-mocha-reporter.svg?branch=master)](https://travis-ci.org/litixsoft/karma-mocha-reporter)\n[![david-dm](https://david-dm.org/litixsoft/karma-mocha-reporter.svg?theme=shields.io)](https://david-dm.org/litixsoft/karma-mocha-reporter/)\n[![david-dm](https://david-dm.org/litixsoft/karma-mocha-reporter/dev-status.svg?theme=shields.io)](https://david-dm.org/litixsoft/karma-mocha-reporter#info=devDependencies\u0026view=table)\n\n## How does it look like\n![screenshot](demo/screen.png)\n\n## Installation\nThe easiest way is to keep `karma-mocha-reporter` as a devDependency in your `package.json`.\n```json\n{\n  \"devDependencies\": {\n    \"karma\": \"^1.0.0\",\n    \"karma-mocha-reporter\": \"^2.0.0\"\n  }\n}\n```\n\nYou can simply do it by:\n\n    $ npm install karma-mocha-reporter --save-dev\n\n## Configuration\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['jasmine'],\n\n    // reporters configuration\n    reporters: ['mocha']\n  });\n};\n```\n\n## Options\n### colors\n**Type:** Object | Boolean\n\nLets you overwrite the default colors. Possible values are all colors and background colors from [chalk](https://github.com/chalk/chalk#colors).\n\n**Possible Values:**\n\nValue | Description | Default\n------ | ----------- | -------\n`success` | success messages | green\n`info` | info messages | grey\n`warning` | warn messages | yellow\n`error` | error messages | red\n\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['jasmine'],\n\n    // reporters configuration\n    reporters: ['mocha'],\n\n    // reporter options\n    mochaReporter: {\n      colors: {\n        success: 'blue',\n        info: 'bgGreen',\n        warning: 'cyan',\n        error: 'bgRed'\n      },\n      symbols: {\n        success: '+',\n        info: '#',\n        warning: '!',\n        error: 'x'\n      }\n    }\n  });\n};\n```\n\nTo disable the colors please use the `colors` option in the karma config.\n\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['jasmine'],\n\n    // reporters configuration\n    reporters: ['mocha'],\n\n    // disable colors\n    colors: false\n  });\n};\n```\n\n### symbols\n**Type:** Object\n\nLets you overwrite the default symbols.\n\n**Possible Values:**\n\nValue | Description | Default\n------ | ----------- | -------\n`success` | success messages | ✔\n`info` | info messages | ℹ\n`warning` | warn messages | ⚠\n`error` | error messages | ✖\n\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['jasmine'],\n\n    // reporters configuration\n    reporters: ['mocha'],\n\n    // reporter options\n    mochaReporter: {\n      symbols: {\n        success: '+',\n        info: '#',\n        warning: '!',\n        error: 'x'\n      }\n    }\n  });\n};\n```\n\n### output\n**Type:** String\n\n**Possible Values:**\n\nValue | Description\n------ | -----------\n`full` (default) | all output is printed to the console\n`autowatch` | first run will have the full output and the next runs just output the summary and errors in mocha style\n`minimal` | only the summary and errors are printed to the console in mocha style\n`noFailures` | the failure details are not logged\n\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['jasmine'],\n\n    // reporters configuration\n    reporters: ['mocha'],\n\n    // reporter options\n    mochaReporter: {\n      output: 'autowatch'\n    }\n  });\n};\n```\n\n### showDiff\n**Type:** String | Boolean\n\nShows a diff output. Is disabled by default. All credits to the contributors of [mocha](https://github.com/mochajs/mocha), since the diff logic is used from there and customized for this module.\n\n![screenshot](demo/diff.png)\n\nCurrently only works with karma-mocha \u003e= v0.2.2 Not supported for karma-jasmine since the additional properties needed to render the diff are not supported in jasmine yet.\n\n**Possible Values:**\n\nValue | Description\n------ | -----------\n`true` | prints each diff in its own line, same as `'unified'`\n`'unified'` | prints each diff in its own line\n`'inline'` | prints diffs inline\n\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['mocha', 'chai'],\n\n    // reporters configuration\n    reporters: ['mocha'],\n\n    // reporter options\n    mochaReporter: {\n      showDiff: true\n    }\n  });\n};\n```\n\n### divider\n**Type:** String\n\n**Default:** 80 equals signs ('=')\n\nThe string to output between multiple test runs. Set to `false` or empty string to disable\n\n```js\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['jasmine'],\n\n    // reporters configuration\n    reporters: ['mocha'],\n\n    // reporter options\n    mochaReporter: {\n      divider: ''\n    }\n  });\n};\n```\n\n### ignoreSkipped\n**Type:** Boolean\n\n**Possible Values:**\n  * `false` (default)\n  * `true`\n\nWhen setting the ignoreSkipped flag to true, the reporter will ignore the skipped tests in the output and you will see\nonly the tests that where really executed. The summary will still contain the number of skipped tests.\n\n### maxLogLines\n**Type:** Number\n\nLets you set the maximum number of lines which are printed for a failure. The default value is 999. Helps to cut long stack traces.\nSet the value to `-1` to disable stack traces.\n\n### printFirstSuccess\n**Type:** Boolean\n\n**Possible Values:**\n  * `false` (default)\n  * `true`\n\nPrints the result of an it block after it is run in one browser. This options is useful when you have tests which are conditionally run in one browser only.\nOtherwise the result of the it block would not be printed because it was not run in all browsers.\n\n```js\n// testfile.spec.js\nif (navigator.userAgent.match(/firefox/i)) {\n  describe('Firefox tests', function() {\n    it('this would only be reported when printFirstSuccess is true', function() {\n      console.log('firefox test');\n    });\n  });\n}\n\ndescribe('Other tests', function() {\n  it('this should be always reported', function() {\n    console.log('hello world');\n  });\n});\n```\n\n\n## Contributing\nIn lieu of a formal styleguide take care to maintain the existing coding style. Lint and test your code using [grunt](http://gruntjs.com/).\n\nYou can preview your changes by running:\n\n    $ npm run demo\n\n## Author\n[Litixsoft GmbH](http://www.litixsoft.de)\n\n## License\nCopyright (C) 2013-2017 Litixsoft GmbH \u003cinfo@litixsoft.de\u003e\nLicensed under the MIT license.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included i\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitixsoft%2Fkarma-mocha-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitixsoft%2Fkarma-mocha-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitixsoft%2Fkarma-mocha-reporter/lists"}