Skip to content

test: add comprehensive coverage for TOCTOU fix error paths #837

@Mossaka

Description

@Mossaka

Tracking issue from closed PR #768.

The TOCTOU fix in PR #766 introduced error handling branches that reduced ssl-bump.ts branch coverage from 100% to 81.25%, failing the coverage regression check.

Changes needed

  • Add tests for EEXIST error handling (file already exists - should be silently caught)
  • Add tests for non-EEXIST errors (permission denied, etc. - should be re-thrown)
  • Add test for non-Error throws in generateSessionCa (string rejection handling)
  • Fix ESLint rule name: prefer-promise-reject-with-error@typescript-eslint/prefer-promise-reject-errors

Target: ssl-bump.ts branch coverage from 81.25% → 100%

Original PR: #768

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions