Skip to content

test: snapshot the RawClient wire-request contract (method/path/headers/body per endpoint) #79

Description

@goanpeca

The SDK has two public output contracts: the exported API surface (types plus named exports) and the wire requests it sends to B2. The API-surface half is already tracked by #52 (API-surface / SemVer gate). The wire half is not pinned anywhere: the simulator asserts behavior (round-trips), but nothing locks the exact request shape RawClient emits per endpoint, so an accidental change to a header name, an encoding, or a JSON field can pass the whole suite unnoticed.

Proposal: add snapshot tests that capture, for each RawClient native endpoint, the exact outbound request: method, URL path, header set (names plus encoding, with auth tokens redacted), and the serialized body. Drive them through a recording transport (or the simulator's request hook) so no network is needed.

This makes the wire contract reviewable: any diff to a snapshot shows up in code review, so a protocol-affecting change is intentional rather than silent.

Acceptance criteria:

  • A snapshot test per RawClient endpoint covering method, path, headers (redacted), and body.
  • Snapshots are deterministic across runtimes (stable ordering, no timestamps/nonces leaking in) and run in the standard suite.
  • A short CONTRIBUTING note on when regenerating these snapshots is expected.

Related: #52 covers the complementary API-surface / SemVer contract; this issue is strictly the on-the-wire request shape.

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions