Download packages/console/app/test/pricing.test.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 799 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/app/test/pricing.test.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/console/app/test/pricing.test.ts
-
curl -L -o pricing.test.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/app/test/pricing.test.ts
799 Bytes
| import { describe, expect, test } from "bun:test" | |
| import { isPeakPricing } from "../src/routes/zen/util/pricing" | |
| describe("isPeakPricing", () => { | |
| test.each([ | |
| ["weekday 09:00 CN starts peak pricing", "2026-08-27T01:00:00.000Z", true], | |
| ["weekday 12:00 CN ends peak pricing", "2026-08-27T04:00:00.000Z", false], | |
| ["weekday 14:00 CN starts peak pricing", "2026-08-27T06:00:00.000Z", true], | |
| ["weekday 18:00 CN ends peak pricing", "2026-08-27T10:00:00.000Z", false], | |
| ["Saturday in Beijing", "2026-08-29T01:00:00.000Z", false], | |
| ["Sunday in Beijing", "2026-08-30T06:00:00.000Z", false], | |
| ["Monday in Beijing", "2026-08-31T01:00:00.000Z", true], | |
| ] as const)("handles %s", (_name, timestamp, expected) => { | |
| expect(isPeakPricing(new Date(timestamp))).toBe(expected) | |
| }) | |
| }) | |