Skip to content

Commit ed5de7f

Browse files
committed
test(usage): use fixed reset boundary timestamps
1 parent 870f8ae commit ed5de7f

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

‎packages/shared/src/usageLimits.test.ts‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,13 @@ function provider(overrides: Partial<ServerProvider>): ServerProvider {
5757

5858
describe("pace", () => {
5959
it.each([
60-
[60_000, "resets in 1m"],
61-
[59_999, "Resets momentarily"],
62-
[1, "Resets momentarily"],
63-
[0, "resets now"],
64-
[-1, "resets now"],
65-
])("formats the reset boundary at %i milliseconds", (remaining, label) => {
66-
expect(
67-
// @effect-diagnostics-next-line globalDate:off
68-
formatResetsIn({ ...window, resetsAt: new Date(now + remaining).toISOString() }, now),
69-
).toBe(label);
60+
["2026-09-03T12:01:00.000Z", "resets in 1m"],
61+
["2026-09-03T12:00:59.999Z", "Resets momentarily"],
62+
["2026-09-03T12:00:00.001Z", "Resets momentarily"],
63+
["2026-09-03T12:00:00.000Z", "resets now"],
64+
["2026-09-03T11:59:59.999Z", "resets now"],
65+
])("formats the reset boundary at %s", (resetsAt, label) => {
66+
expect(formatResetsIn({ ...window, resetsAt }, now)).toBe(label);
7067
});
7168

7269
it("ignores invalid reset timestamps", () => {

0 commit comments

Comments
 (0)