{"id":13508128,"url":"https://github.com/karma-runner/karma-coverage","last_synced_at":"2025-03-30T09:33:22.899Z","repository":{"id":7172938,"uuid":"8474328","full_name":"karma-runner/karma-coverage","owner":"karma-runner","description":"A Karma plugin. Generate code coverage.","archived":false,"fork":false,"pushed_at":"2024-10-09T18:56:48.000Z","size":1409,"stargazers_count":770,"open_issues_count":137,"forks_count":247,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-18T04:38:38.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/karma-runner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null}},"created_at":"2013-02-28T07:44:44.000Z","updated_at":"2025-02-05T02:00:07.000Z","dependencies_parsed_at":"2024-06-02T12:02:56.979Z","dependency_job_id":"19517bda-6061-4f5a-b085-58baf5490c52","html_url":"https://github.com/karma-runner/karma-coverage","commit_stats":{"total_commits":219,"total_committers":63,"mean_commits":"3.4761904761904763","dds":0.7808219178082192,"last_synced_commit":"55eb8a85f8243af3ae9cf75460a780fc5c71761f"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karma-runner%2Fkarma-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karma-runner","download_url":"https://codeload.github.com/karma-runner/karma-coverage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112666,"owners_count":20725301,"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-01T02:00:48.560Z","updated_at":"2025-03-30T09:33:22.632Z","avatar_url":"https://github.com/karma-runner.png","language":"JavaScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"# karma-coverage\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma-coverage)\n [![npm version](https://img.shields.io/npm/v/karma-coverage.svg?style=flat-square)](https://www.npmjs.com/package/karma-coverage) [![npm downloads](https://img.shields.io/npm/dm/karma-coverage.svg?style=flat-square)](https://www.npmjs.com/package/karma-coverage)\n\n[![Build Status](https://img.shields.io/travis/karma-runner/karma-coverage/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma-coverage) [![Dependency Status](https://img.shields.io/david/karma-runner/karma-coverage.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-coverage) [![devDependency Status](https://img.shields.io/david/dev/karma-runner/karma-coverage.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-coverage#info=devDependencies)\n\n\u003e Generate code coverage using [Istanbul].\n\n## Installation\n\nThe easiest way is to install `karma-coverage` as a `devDependency`,\nby running\n\n```bash\nnpm install karma karma-coverage --save-dev\n```\n\n## Configuration\n\nFor configuration details see [docs/configuration](docs/configuration.md).\n\n## Examples\n\n### Basic\n\n```javascript\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    files: [\n      'src/**/*.js',\n      'test/**/*.js'\n    ],\n\n    // coverage reporter generates the coverage\n    reporters: ['progress', 'coverage'],\n\n    preprocessors: {\n      // source files, that you wanna generate coverage for\n      // do not include tests or libraries\n      // (these files will be instrumented by Istanbul)\n      'src/**/*.js': ['coverage']\n    },\n\n    // optionally, configure the reporter\n    coverageReporter: {\n      type : 'html',\n      dir : 'coverage/'\n    }\n  });\n};\n```\n### CoffeeScript\n\nFor an example on how to use with [CoffeeScript](http://coffeescript.org/)\nsee [examples/coffee](examples/coffee). For an example of how to use with\nCoffeeScript and the RequireJS module loader, see\n[examples/coffee-requirejs](examples/coffee-requirejs) (and also see\nthe `useJSExtensionForCoffeeScript` option in\n[docs/configuration.md](docs/configuration.md)).\n\n### Advanced, multiple reporters\n\n```javascript\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    files: [\n      'src/**/*.js',\n      'test/**/*.js'\n    ],\n    reporters: ['progress', 'coverage'],\n    preprocessors: {\n      'src/**/*.js': ['coverage']\n    },\n    coverageReporter: {\n      // specify a common output directory\n      dir: 'build/reports/coverage',\n      reporters: [\n        // reporters not supporting the `file` property\n        { type: 'html', subdir: 'report-html' },\n        { type: 'lcov', subdir: 'report-lcov' },\n        // reporters supporting the `file` property, use `subdir` to directly\n        // output them in the `dir` directory\n        { type: 'cobertura', subdir: '.', file: 'cobertura.txt' },\n        { type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' },\n        { type: 'teamcity', subdir: '.', file: 'teamcity.txt' },\n        { type: 'text', subdir: '.', file: 'text.txt' },\n        { type: 'text-summary', subdir: '.', file: 'text-summary.txt' },\n      ]\n    }\n  });\n};\n```\n\n### FAQ\n\n#### Don't minify instrumenter output\n\nWhen using the istanbul instrumenter (default), you can disable code compaction by adding the following to your configuration.\n\n```javascript\n// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    coverageReporter: {\n      instrumenterOptions: {\n        istanbul: { noCompact: true }\n      }\n    }\n  });\n};\n```\n\n----\n\nFor more information on Karma see the [homepage].\n\n\n[homepage]: https://karma-runner.github.io\n[Istanbul]: https://istanbul.js.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarma-runner%2Fkarma-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarma-runner%2Fkarma-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarma-runner%2Fkarma-coverage/lists"}