Coverage

Get file coverage

Retrieve line-by-line test coverage data for a file at a specific Git reference or commit SHA

get/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/coverage/file

Request

  • Base URL
    https://api.qlty.sh
  • Auth
    HTTP bearer

Path parameters

ownerKeyOrIdstring required

Repository owner name (login) or workspace ID

Example:acme-corp
projectKeyOrIdstring required

Repository name or project ID

Example:my-repo

Query parameters

referencestring required

Git reference (refs/heads/branch, refs/tags/tag) or commit SHA

Example:refs/heads/main
pathstring required

File path to get coverage for

Example:src/index.ts

Response

Retrieve file coverage for the specified path

tagsstring[] required

Available coverage tags

Example response

{
  "tags": [
    "unit",
    "integration"
  ],
  "files": [
    {
      "path": "src/index.ts",
      "hits": [
        1,
        0,
        1,
        1,
        0
      ],
      "tag": "unit",
      "coveredLines": 42,
      "missedLines": 8,
      "omitLines": 10,
      "totalLines": 60
    }
  ]
}

Changes

No recorded changes to this operation across all 8 revisions of this API.