Quota test: use the current time instead of a fixed date
The rolling-window test broke once the hard-coded date was more than a day old, because entries older than 24 h are pruned on every write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4c78b76586
commit
ac7d6f3ed8
@ -67,7 +67,7 @@ test("YouTube's budget is shared by all clients; per-account platforms are separ
|
||||
|
||||
test("rolling 24 h windows free up when the oldest post ages out", () => {
|
||||
reset();
|
||||
const at = Date.parse("2026-10-21T12:00:00Z");
|
||||
const at = Date.now(); // relative to now: entries older than 24 h are pruned on every write
|
||||
const first = at - 20 * H;
|
||||
quota.record("tiktok", "acct", "publish", first);
|
||||
for (let i = 1; i < 15; i++) quota.record("tiktok", "acct", "publish", at - H);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user