{"id":15314688,"url":"https://github.com/unframework/karma-coverage","last_synced_at":"2025-10-09T00:32:37.530Z","repository":{"id":11161248,"uuid":"13533452","full_name":"unframework/karma-coverage","owner":"unframework","description":"A Karma plugin. Generate code coverage.","archived":false,"fork":true,"pushed_at":"2013-10-13T05:04:21.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T18:22:16.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"karma-runner/karma-coverage","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-13T04:05:18.000Z","updated_at":"2019-08-13T15:28:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/unframework/karma-coverage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fkarma-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fkarma-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fkarma-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unframework%2Fkarma-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unframework","download_url":"https://codeload.github.com/unframework/karma-coverage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219877247,"owners_count":16554912,"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-10-01T08:46:42.347Z","updated_at":"2025-10-09T00:32:32.255Z","avatar_url":"https://github.com/unframework.png","language":"CoffeeScript","readme":"# karma-coverage [![Build Status](https://travis-ci.org/karma-runner/karma-coverage.png?branch=master)](https://travis-ci.org/karma-runner/karma-coverage)\n\n\u003e Generate code coverage using [Istanbul].\n\n## Installation\n\nThe easiest way is to keep `karma-coverage` as a devDependency in your `package.json`.\n```json\n{\n  \"devDependencies\": {\n    \"karma\": \"~0.10\",\n    \"karma-coverage\": \"~0.1\"\n  }\n}\n```\n\nYou can simple do it by:\n```bash\nnpm install karma-coverage --save-dev\n```\n\n## Configuration\nFollowing code shows the default configuration...\n```js\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\n### Options\n#### type\n**Type:** String\n\n**Possible Values:**\n  * `html` (default)\n  * `lcov` (lcov and html)\n  * `lcovonly`\n  * `text`\n  * `text-summary`\n  * `cobertura` (xml format supported by Jenkins)\n\nIf you set `type` to `text` or `text-summary`, you may set the `file` option, like this.\n```javascript\ncoverageReporter = {\n  type : 'text',\n  dir : 'coverage/',\n  file : 'coverage.txt'\n}\n```\nIf no filename is given, it will write the output to the console.\n\n#### dir\n**Type:** String\n\n**Description:** This will be used to output coverage reports. When\n  you set a relative path, the directory is resolved against the `basePath`.\n\n----\n\nFor more information on Karma see the [homepage].\n\n\n[homepage]: http://karma-runner.github.com\n[Istanbul]: https://github.com/yahoo/istanbul\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funframework%2Fkarma-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funframework%2Fkarma-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funframework%2Fkarma-coverage/lists"}