Skip to content

Conversation

@shanejonas
Copy link
Member

Motivation

  • Improve test coverage to 100% by exercising remaining branches and behaviors in the codebase.
  • Verify reporter lifecycle calls and ensure rule lifecycle hooks behave correctly under success, failure, and removal scenarios.
  • Cover rule behaviors for skip/only/options and different paramStructure cases for JsonSchemaFakerRule.

Description

  • Added new reporter unit tests in src/reporters/emptyReporter.test.ts to exercise logging and summary paths for EmptyReporter.
  • Expanded src/coverage.test.ts with tests that run rule lifecycle hooks, preserve existing timings, verify transport failure handling (no validation on request error), and ensure lifecycle hooks are skipped when call.rule is removed by a reporter.
  • Added additional JsonSchemaFakerRule unit tests in src/rules/json-schema-faker-rule.test.ts to cover skip/only, example-skipping, and non-by-name parameter structures; updated test instantiations to pass full RulesOptions where required.
  • Small test-only type relaxations (as any) were used to satisfy TypeScript shapes for synthetic test calls.

Testing

  • Ran npm test -- --coverage and all test suites passed (25 passed, 25 total).
  • Coverage report shows 100% on statements/branches/functions/lines for the src directory after the changes.
  • Tests exercised: reporter behavior, lifecycle hook invocation order, transport error handling, and rule branching logic.
  • Lint step (npm run lint) executed as part of the npm test script without failing.

Codex Task

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ed8ac57) to head (9567b5d).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #494   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          180       180           
  Branches        51        51           
=========================================
  Hits           180       180           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants