The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { afterEach, describe, expect, it, vi } from "vite-plus/test"; |
| 2 | |
| 3 | import { fetchLatestRelease } from "./releases"; |
| 4 | |
| 5 | afterEach(() => { |
| 6 | vi.unstubAllGlobals(); |
| 7 | }); |
| 8 | |
| 9 | describe("fetchLatestRelease", () => { |
| 10 | it("rejects a GitHub API error response instead of returning it as a release", async () => { |
| 11 | vi.stubGlobal("sessionStorage", { getItem: () => null }); |
| 12 | vi.stubGlobal("fetch", async () => |
| 13 | Response.json({ message: "API rate limit exceeded" }, { status: 403 }), |
| 14 | ); |
| 15 | |
| 16 | await expect(fetchLatestRelease("stable")).rejects.toThrow("403"); |
| 17 | }); |
| 18 | }); |