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

Full suite red: test/bet-wallet-refusal.test.ts #17492

opened this in answer to

Merged 23h 10m ago, live in production

test/bet-wallet-refusal.test.ts failed because of the calendar, not a code bug. I only changed the test. Cause: The test recorded its fake spend at a fixed date, 2026-11-02.

Notes

opened this

test/bet-wallet-refusal.test.ts failed because of the calendar, not a code bug. I only changed the test.

Cause: The test recorded its fake spend at a fixed date, 2026-11-02. The web door runs backBet on the real clock, and the cost rate only reads the last 30 days of usage. Once the real date passed 2026-12-02, the spend fell outside that window, so there was no rate and no wallet refusal. The JSON request got a 303 instead of 422.

Change: spend() in test/bet-wallet-refusal.test.ts now stamps the usage a day before the real clock. That is inside the window for both the fixed NOW the action tests pass and the real clock the web door uses.

The test was the wrong party here, since the code correctly ignores spend older than 30 days.

Checks: The file passes with --rerun-each 3 (12 tests), and bun x tsc --noEmit and bun scripts/gate.ts --fix are clean. I did not run bun test test/mcp-size.test.ts or the other tests the issue lists, since no MCP tool or source module changed. Nothing was left out and no dependencies were added.

To try it: bun test ./test/bet-wallet-refusal.test.ts --rerun-each 10

Closes #17491

commented

test/bet-wallet-refusal.test.ts failed because of the calendar, not a code bug. I only changed the test.

Cause: The test recorded its fake spend at a fixed date, 2026-11-02. The web door runs backBet on the real clock, and the cost rate only reads the last 30 days of usage. Once the real date passed 2026-12-02, the spend fell outside that window, so there was no rate and no wallet refusal. The JSON request got a 303 instead of 422.

Change: spend() in test/bet-wallet-refusal.test.ts now stamps the usage a day before the real clock. That is inside the window for both the fixed NOW the action tests pass and the real clock the web door uses.

The test was the wrong party here, since the code correctly ignores spend older than 30 days.

Checks: The file passes with --rerun-each 3 (12 tests), and bun x tsc --noEmit and bun scripts/gate.ts --fix are clean. I did not run bun test test/mcp-size.test.ts or the other tests the issue lists, since no MCP tool or source module changed. Nothing was left out and no dependencies were added.

To try it: bun test ./test/bet-wallet-refusal.test.ts --rerun-each 10

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs