Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

jest-coverage

verified

Jest code coverage configuration and analysis

View on GitHub

Marketplace

alphaagent-team

the-answerai/alphaagent-team

Plugin

aai-stack-jest

stack

Repository

the-answerai/alphaagent-team

plugins/aai-stack-jest/skills/jest-coverage/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-stack-jest/skills/jest-coverage/SKILL.md -a claude-code --skill jest-coverage

Installation paths:

Claude
.claude/skills/jest-coverage/
Powered by add-skill CLI

Instructions

# Jest Coverage Skill

Patterns for configuring and analyzing code coverage in Jest.

## Configuration

### Basic Coverage Config

```javascript
// jest.config.js
module.exports = {
  collectCoverage: true,
  coverageDirectory: 'coverage',
  coverageReporters: ['text', 'lcov', 'html'],
  collectCoverageFrom: [
    'src/**/*.{js,jsx,ts,tsx}',
    '!src/**/*.d.ts',
    '!src/**/*.test.{js,jsx,ts,tsx}',
    '!src/**/__tests__/**',
    '!src/**/__mocks__/**',
  ],
}
```

### Coverage Thresholds

```javascript
// jest.config.js
module.exports = {
  coverageThreshold: {
    // Global thresholds
    global: {
      branches: 80,
      functions: 80,
      lines: 80,
      statements: 80,
    },
    // Per-directory thresholds
    './src/utils/': {
      branches: 90,
      functions: 90,
      lines: 90,
      statements: 90,
    },
    // Per-file thresholds
    './src/critical-module.ts': {
      branches: 100,
      functions: 100,
      lines: 100,
      statements: 100,
    },
  },
}
```

### Coverage Reporters

```javascript
// jest.config.js
module.exports = {
  coverageReporters: [
    'text',           // Console output
    'text-summary',   // Condensed console output
    'lcov',           // For CI tools (Codecov, Coveralls)
    'html',           // Browser-viewable report
    'json',           // Machine-readable
    'json-summary',   // Condensed JSON
    'cobertura',      // XML format for CI
    'clover',         // Clover XML format
  ],
}
```

## Running Coverage

### CLI Commands

```bash
# Run with coverage
jest --coverage

# Run specific files with coverage
jest --coverage --collectCoverageFrom='src/utils/**/*.ts' src/utils

# Update snapshots with coverage
jest --coverage --updateSnapshot

# Watch mode with coverage
jest --coverage --watch

# Coverage with verbose output
jest --coverage --verbose

# Coverage threshold check only
jest --coverage --coverageThreshold='{"global":{"lines":80}}'
```

### Package.json Scripts

```json
{
  "scripts": {
    "te

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7575 chars