Skip to content

ci: add unit test workflow with coverage thresholds and lint fixes#97

Merged
sugat009 merged 1 commit intomainfrom
ci/add-test-workflow
Apr 30, 2026
Merged

ci: add unit test workflow with coverage thresholds and lint fixes#97
sugat009 merged 1 commit intomainfrom
ci/add-test-workflow

Conversation

@sugat009
Copy link
Copy Markdown
Member

@sugat009 sugat009 commented Apr 16, 2026

Summary

  • Add GitHub Actions CI workflow (unit_tests.yml) that runs build, lint, and test with coverage on every PR to main
  • Add .nycrc.json with coverage thresholds: 95% statements/lines/functions, 85% branches
  • Align ESLint config with CHT standards by adding eslint-plugin-n (Node.js rules), eslint-plugin-promise, and eslint-plugin-no-only-tests
  • Fix all pre-existing lint errors: exclude coverage/ from ESLint, allow require() in tests (proxyquire), resolve no-explicit-any warnings
  • Update @typescript-eslint/eslint-plugin and @typescript-eslint/parser to latest v8 (8.58.2)

Test plan

  • CI workflow triggers on PR and passes build, lint, and test steps
  • Coverage thresholds enforce minimums (95%/85% branches)
  • no-only-tests rule catches accidental it.only() / describe.only() in tests
  • npm run lint passes locally with 0 errors and 0 warnings
  • Existing PRs work after rebasing on main

Add GitHub Actions CI workflow that runs build, lint, and tests with
coverage on PRs. Align ESLint config with CHT standards by adding
eslint-plugin-n, eslint-plugin-promise, and no-only-tests. Fix all
pre-existing lint errors and warnings.
@sonarqubecloud
Copy link
Copy Markdown

@sugat009 sugat009 requested a review from Hareet April 16, 2026 08:20
@sugat009 sugat009 self-assigned this Apr 16, 2026
@sugat009 sugat009 moved this from Todo to In Review in CHT Multi-Agent System (cht-agent) Apr 16, 2026
Copy link
Copy Markdown
Member

@Hareet Hareet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Summary

● Confirmed: no-only-tests rule is correctly wired — fired with describe.only not permitted error. File reverted, no diff. Test plan scenario passes.

Coverage vs thresholds (.nycrc.json):

  ┌────────────┬────────┬───────────┐                                                                                                                                                                                          
  │   Metric   │ Result │ Threshold │                                                                                
  ├────────────┼────────┼───────────┤                                                                                                                                                                                          
  │ Statements │ 96.82% │ 95 ✓      │
  ├────────────┼────────┼───────────┤                                                                                                                                                                                          
  │ Branches   │ 86.13% │ 85 ✓      │                                                                                
  ├────────────┼────────┼───────────┤
  │ Functions  │ 100%   │ 95 ✓      │
  ├────────────┼────────┼───────────┤
  │ Lines      │ 96.77% │ 95 ✓      │
  └────────────┴────────┴───────────┘     

@sugat009 sugat009 merged commit 8756446 into main Apr 30, 2026
7 checks passed
@sugat009 sugat009 deleted the ci/add-test-workflow branch April 30, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants