Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Enforce a coverage threshold in `jest.config.js` and report it in CI

Open
#173 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, nodejs, typescript
Domain
ci-cd, testing

Research direction

Start in jest.config.js, where collectCoverageFrom and coverageDirectory are set, and in .github/workflows/build-check.yml, where the existing test step runs around lines 31-36. Run npm run test:cov locally to record the baseline, then add a coverageThreshold.global at or below it and a CI step that runs the same command and uploads the coverage directory as an artifact. Done when the threshold is set, the baseline is recorded, lcov is in coverageReporters, and CI passes on main.

Written by the indexing model from the issue text.

Description

good first issue tests tooling

Problem

jest.config.js collects coverage but sets no threshold:

collectCoverageFrom: ['**/*.(t|j)s'],
coverageDirectory: '../coverage',

There is no coverageThreshold, and .github/workflows/build-check.yml never runs npm run test:cov — it runs npm test -- --runInBand with a narrow path filter (lines 31-36). So coverage is collected only when a developer opts in locally, and nothing prevents it from falling.

Two contributing factors: 68 of 106 services have no colocated spec (see the other test issues in this batch), and five specs under test/ are never executed at all because rootDir: 'src'.

Why it matters

ROADMAP.md lists "Reach 80% code coverage across all modules" as a v0.2.0 goal. With no threshold in place and coverage never computed in CI, there is no mechanism to measure progress toward that goal — so it cannot be met or missed, just asserted.

Suggested Direction

  1. Measure first. Run npm run test:cov on the current main and record the real numbers in a comment or in docs/. Whatever they turn out to be, that is the honest baseline.
  2. Set a ratchet, not an aspirational number. Pick thresholds at or just below the measured baseline:
    coverageThreshold: {
      global: { branches: <b>, functions: <f>, lines: <l>, statements: <s> },
    },
    
    Then raise them as coverage improves. A threshold above current reality fails CI on the first run and gets deleted; a ratchet below it holds the line.
  3. Add a CI step in .github/workflows/build-check.yml running npm run test:cov, and upload the coverage report as an artifact so reviewers can inspect it.
  4. Consider coverageReporters: ['text', 'lcov'] so the lcov output is usable by an external service.

Constraints

  • Do not combine the threshold with a large test-writing push — land the ratchet first, then raise it. Otherwise the PR is unreviewable.
  • Leave test/ out of coverageThreshold until the unreachable-spec issue is resolved, or the threshold will be calculated against a partial picture.
  • Keep the existing narrow test-path filter in the main CI job as-is; this is additive.

Acceptance Criteria

  • coverageThreshold.global is set in jest.config.js at or below the measured current baseline.
  • The measured baseline numbers are recorded in the issue or docs/.
  • CI runs npm run test:cov and passes on the current main.
  • A coverage report is uploaded as a CI artifact.
  • coverageReporters includes lcov.
Dominant language
TypeScript
Stars
7
Forks
55
Avg merge
1d 17h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SourceXXL/alian_structure-api

All issues in SourceXXL/alian_structure-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.