Skip to content

Lower Jest coverage thresholds to match current coverage levels#95

Closed
Copilot wants to merge 2 commits into
copilot/combine-integration-tests-and-fixesfrom
copilot/lower-coverage-thresholds
Closed

Lower Jest coverage thresholds to match current coverage levels#95
Copilot wants to merge 2 commits into
copilot/combine-integration-tests-and-fixesfrom
copilot/lower-coverage-thresholds

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 30, 2026

CI failing on coverage checks: thresholds set at 80% but actual coverage is 37-47%. All 251 tests pass.

Changes

Updated coverage thresholds in two Jest configs to reflect actual coverage with headroom for fluctuation:

  • jest.config.js and jest.unit.config.js: Lowered thresholds from 80% to:
    • branches: 35 (current: 37.67%)
    • functions: 45 (current: 46.47%)
    • lines: 45 (current: 47.35%)
    • statements: 45 (current: 46.4%)

Added inline comment documenting aspirational 80% goal for gradual improvement.

coverageThreshold: {
  global: {
    // Current thresholds - gradually increase toward 80% goal
    branches: 35,    // Current: 37.67%
    functions: 45,   // Current: 46.47%
    lines: 45,       // Current: 47.35%
    statements: 45   // Current: 46.4%
  }
}

Other module-specific Jest configs (src/database/jest.config.js, src/ipfs/jest.config.js) already use 70% thresholds and are unchanged.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • rpc-mumbai.maticvigil.com
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/VEXEL/VEXEL/node_modules/jest-REDACTED/node_modules/jest-worker/build/workers/processChild.js (dns block)
  • scarf.sh
    • Triggering command: /usr/local/bin/node node ./report.js ../../nan -I ode_�� es/src/string_vi-I s/src/string_vie/home/REDACTED/.cache/node-gyp/20.20.0/deps/openssl/config 20.0/src r-strong 20.0/deps/openss-I y 20.0/deps/openss-I ode_�� 20.0/include/nod-I (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Problem

CI is failing due to coverage thresholds not being met:

Jest: "global" coverage threshold for statements (80%) not met: 46.4%
Jest: "global" coverage threshold for branches (80%) not met: 37.67%
Jest: "global" coverage threshold for lines (80%) not met: 47.35%
Jest: "global" coverage threshold for functions (80%) not met: 46.47%

All 251 tests pass successfully, but the codebase doesn't have 80% coverage yet. The 80% threshold is aspirational but unrealistic for the current state of the codebase.

Solution

Lower the coverage thresholds in jest.config.js to reflect the current actual coverage levels, with room for gradual improvement:

File: jest.config.js

Change the coverageThreshold section from:

coverageThreshold: {
  global: {
    branches: 80,
    functions: 80,
    lines: 80,
    statements: 80
  }
}

To:

coverageThreshold: {
  global: {
    branches: 35,    // Current: 37.67%
    functions: 45,   // Current: 46.47%
    lines: 45,       // Current: 47.35%
    statements: 45   // Current: 46.4%
  }
}

These thresholds are:

  • Slightly below current coverage to allow for small fluctuations
  • Realistic starting points that won't block development
  • Can be gradually increased as test coverage improves

Alternative Approach (Optional)

If you want to keep the aspirational 80% goal visible, add a comment:

coverageThreshold: {
  global: {
    // Current thresholds - gradually increase toward 80% goal
    branches: 35,
    functions: 45,
    lines: 45,
    statements: 45
  }
}

Expected Outcome

  • All tests pass: ✅
  • Coverage checks pass: ✅
  • CI completes successfully: ✅
  • No "Force exiting Jest" error: ✅
  • Exit code 0

Note

This change only affects the main jest.config.js. The other Jest configs in src/database/jest.config.js and src/ipfs/jest.config.js already have lower thresholds (70%) and don't need changes.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: colleenpridemore <4281084+colleenpridemore@users.noreply.github.com>
Copilot AI changed the title [WIP] Lower Jest coverage thresholds for CI Lower Jest coverage thresholds to match current coverage levels Jan 30, 2026
Copy link
Copy Markdown
Contributor

Superseded by #100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants