Spaces:
Paused
Paused
Download node_modules/@huggingface/hub/src/lib/delete-branch.spec.ts from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40huggingface/hub/src/lib/delete-branch.spec.ts
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@huggingface/hub/src/lib/delete-branch.spec.ts
-
curl -L -o delete-branch.spec.ts https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40huggingface/hub/src/lib/delete-branch.spec.ts
1.15 kB
| import { it, describe } from "vitest"; | |
| import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../test/consts"; | |
| import type { RepoId } from "../types/public"; | |
| import { insecureRandomString } from "../utils/insecureRandomString"; | |
| import { createRepo } from "./create-repo"; | |
| import { deleteRepo } from "./delete-repo"; | |
| import { createBranch } from "./create-branch"; | |
| import { deleteBranch } from "./delete-branch"; | |
| describe("deleteBranch", () => { | |
| it("should delete an existing branch", async () => { | |
| const repoName = `${TEST_USER}/TEST-${insecureRandomString()}`; | |
| const repo = { type: "model", name: repoName } satisfies RepoId; | |
| try { | |
| await createRepo({ | |
| accessToken: TEST_ACCESS_TOKEN, | |
| hubUrl: TEST_HUB_URL, | |
| repo, | |
| }); | |
| await createBranch({ | |
| repo, | |
| branch: "branch-to-delete", | |
| accessToken: TEST_ACCESS_TOKEN, | |
| hubUrl: TEST_HUB_URL, | |
| }); | |
| await deleteBranch({ | |
| repo, | |
| branch: "branch-to-delete", | |
| accessToken: TEST_ACCESS_TOKEN, | |
| hubUrl: TEST_HUB_URL, | |
| }); | |
| } finally { | |
| await deleteRepo({ | |
| repo, | |
| accessToken: TEST_ACCESS_TOKEN, | |
| hubUrl: TEST_HUB_URL, | |
| }); | |
| } | |
| }); | |
| }); | |