Skip to content

test(thetvdb): pin the clock so the fixture token cannot expire - #191

Merged
ralyodio merged 1 commit into
mainfrom
fix/thetvdb-fixture-expiry
Oct 13, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/thetvdb-fixture-expiry

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The CI `test` job fails on main (and every PR, e.g. #190) in `test/screen-thetvdb-catalog.test.js`: the fixture JWT expires 2026-10-13T18:15:21Z and the adapter renews a token within a day of its expiry, so three tests now see an unexpected login.

  • Pin `Date` with `bun:test` `setSystemTime` to 2026-09-20 before each test (reset after all).
  • `FRESH` cursor expiry derives from the pinned time.
  • The page-cap/resume test advances the pinned clock instead of sleeping 5 ms.
  • The hard-coded `1791915321000` is now a named `TOKEN_EXPIRES` constant (the fixture's `exp` claim; time-independent).

Locally: file 18/18 pass; full suite 2356 pass, 0 fail; lint clean (warnings unchanged).

🤖 Generated with Claude Code

The fixture JWT expires 2026-10-13T18:15:21Z and the adapter renews a
token within a day of expiry, so three tests began failing on main once
that day arrived. Pin Date with bun:test setSystemTime before each test,
derive FRESH from the pinned time, and advance the clock instead of
sleeping where a later timestamp is asserted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit b016ff3 into main Oct 13, 2026
3 checks passed
@ralyodio
ralyodio deleted the fix/thetvdb-fixture-expiry branch October 13, 2026 00:11
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.

1 participant