Skip to content

chore: use the API timestamp format in test fixtures - #1049

Merged
felipefreitag merged 1 commit into
canaryfrom
fix/timestamp-format-fixtures
Aug 6, 2026
Merged

chore: use the API timestamp format in test fixtures#1049
felipefreitag merged 1 commit into
canaryfrom
fix/timestamp-format-fixtures

Conversation

@felipefreitag

@felipefreitag felipefreitag commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

The API returns timestamps in Postgres text format: YYYY-MM-DD HH:MM:SS[.ffffff]+00 (for example 2023-10-06 23:47:56.678+00). Our spec fixtures and inline snapshots showed ISO 8601 for response fields. This PR makes them match the real API output.

  • Convert 219 response-fixture timestamps and their inline snapshots in 23 spec files.
  • The HAR recordings already contain the correct format. They hold real recorded API traffic, so they confirm the target.

What stays ISO 8601 on purpose

  • scheduledAt as a request parameter (batch.spec.ts, broadcasts.spec.ts). The API accepts ISO there.
  • revoked_at in the revoke OAuth grant response (oauth-grants.spec.ts). That endpoint returns ISO.

Why

The SDK never parses these values, so there are no runtime changes. But wrong fixtures propagate: new endpoints copy the pattern, and users who read the tests get the wrong contract.

Verification

  • vitest run src: 1880 passed, 20 todo.
  • tsc --noEmit: clean.
  • biome check src: clean.

Summary by cubic

Align test fixtures and inline snapshots with the API’s Postgres timestamp format (YYYY-MM-DD HH:MM:SS[.ffffff]+00) to match real responses and prevent incorrect contracts. No runtime changes.

  • Refactors
    • Converted 219 response timestamps across 23 spec files to Postgres text format.
    • Kept ISO 8601 where the API uses it: scheduledAt request param and revoked_at in OAuth revoke.
    • HAR recordings confirm the format; tests and checks are green (vitest 1880 passed, tsc --noEmit clean, biome clean).

Written for commit a4fa39e. Summary will update on new commits.

Review in cubic

The API returns timestamps in Postgres text format
(2023-10-06 23:47:56.678+00), not ISO 8601. Spec fixtures and
inline snapshots showed ISO 8601 for response fields.

Convert response fixtures and snapshots to the real format. The
HAR recordings already show it: they contain real recorded API
traffic.

Keep ISO 8601 where the API uses it: the scheduledAt request
param (batch.spec.ts, broadcasts.spec.ts:156) and revoked_at in
the revoke response (oauth-grants.spec.ts).

No runtime changes.
@felipefreitag
felipefreitag requested a review from a team as a code owner August 6, 2026 14:15
@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/resend@1049

commit: a4fa39e

@felipefreitag
felipefreitag merged commit 9864b8c into canary Aug 6, 2026
16 checks passed
@felipefreitag
felipefreitag deleted the fix/timestamp-format-fixtures branch August 6, 2026 14:19
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.

2 participants