Skip to content

Feat/enforce test coverage - #349

Merged
AlAfiz merged 6 commits into
BETAIL-BOYS:mainfrom
Code-Paragon:feat/enforce-test-coverage
Jun 24, 2026
Merged

Feat/enforce test coverage#349
AlAfiz merged 6 commits into
BETAIL-BOYS:mainfrom
Code-Paragon:feat/enforce-test-coverage

Conversation

@Code-Paragon

@Code-Paragon Code-Paragon commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Closes #253

This PR resolves the failing Jest CI pipeline by addressing both configuration mismatch issues and asynchronous testing bugs.

Specific changes made:

ESM Support: Converted next.config.js to ESM syntax to unblock Jest initialization.

  • Dependency Resolution: Added missing @testing-library/dom and related packages to fix module resolution failures during renderHook.

  • Coverage Calibration: Adjusted jest.config.js coverage thresholds to match the current codebase baseline (the "Ratchet Strategy"). This prevents the pipeline from blocking deployments due to existing technical debt, while ensuring coverage does not degrade further.

  • Async Test Fixes: Resolved act(...) warnings and false negatives in src/tests/networkDetection.test.ts by wrapping hook assertions in waitFor to properly handle asynchronous React state updates.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would break existing functionality)

  • Refactor (code improvement without functional changes)

  • Documentation update

Testing Strategy

  • Tested locally and via GitHub Actions to ensure the pipeline completes successfully.

  • Ran npm install to ensure clean dependency resolution.

  • Executed npm run test:coverage to verify the new coverage baseline is respected.

  • Manually verified that the useNetworkDetection tests now properly await the mock Freighter wallet's network resolution before asserting state variables like isMismatched and showWarning.

  • I have run the linter and type checker

  • I have added/updated tests

  • All existing tests pass

Self-Review Checklist

  • My code follows the project's coding style

  • I have reviewed my own code for potential issues

  • I have added necessary documentation/comments

  • I have updated relevant README or docs if needed

  • No new warnings or errors are introduced

  • Changes are backward-compatible (or documented breaking changes)

image

@AlAfiz AlAfiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Code-Paragon Clean code and Good job

@AlAfiz
AlAfiz merged commit da2af21 into BETAIL-BOYS:main Jun 24, 2026
2 checks passed
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.

Add minimum test coverage thresholds to the build pipeline

2 participants