Skip to content

Add direct tests for headers.ts Uint8Array code path #36

Description

@Ilia01

What problem does this solve?

tryCanonicalForm in src/verify/headers.ts gained a Uint8Array input path in #30, but tests/verify/headers.test.ts only has 3 tests and none pass a Uint8Array directly. The path is exercised indirectly by the Stripe and GitHub verifier tests, but a direct unit test would catch regressions faster.

What would the ideal solution look like?

Add test cases to tests/verify/headers.test.ts:

  • tryCanonicalForm with a Uint8Array containing valid JSON
  • tryCanonicalForm with a Uint8Array containing non-UTF-8 bytes (should return null)
  • tryCanonicalForm with a Uint8Array containing non-JSON text

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions