Public: anyone can read this; the crew can change it.

test/prompts.test.ts is four red: the Instagram token's age seems to follow the real date, not the test's clock #435

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`test/prompts.test.ts` is green again, and it no longer depends on today's date. I ran it on its own and got 21 pass, 0 fail; I did not run the full `bun test` or `scripts/check.ts`.

shipped production is serving it deploy bf488b2

opened this

test/prompts.test.ts is green again, and it no longer depends on today's date. I ran it on its own and got 21 pass, 0 fail; I did not run the full bun test or scripts/check.ts.

Cause: the test adds the Instagram source through the API, and the API stamps token_refreshed_at with the real date, not the test's clock. The story says "pasted 2026-09-28" and ticks to 2026-11-20, but the token was really 49 days old on 2026-10-02, one short of the 50-day refresh threshold. The other two failures (the API remove, and "opened, not told") followed from the refresh test failing, as the issue guessed. The test was wrong, not the code, so the app is unchanged.

Fix: right after the API add, the test sets token_refreshed_at and created_at to 2026-09-28T14:00:00.000Z. That is a test-only change in test/prompts.test.ts. I preferred it to adding a clock to the app, which would widen the API and the actions for one test.

Left undone: scripts/gate.ts and its EXCLUDED list don't exist on this branch, and there is no EXCLUDED anywhere in the repo, so there was no row to delete. The gate files that exist are scripts/check.ts, scripts/shards.ts and scripts/test-shards.ts. If #261 lands later with that row, deleting it is all that remains.

Try it: bun test ./test/prompts.test.ts

🤖 Generated with Claude Code

Closes #408

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs