Skip to content

Commit

Permalink
🔒 move test creds constants in a separate file (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvmnnnkv authored Oct 29, 2023
1 parent 0073979 commit 95c509b
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
3 changes: 0 additions & 3 deletions packages/hub/src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export const HUB_URL = "https://huggingface.co";
export const TEST_HUB_URL = "https://hub-ci.huggingface.co";
export const TEST_USER = "hub.js";
export const TEST_ACCESS_TOKEN = "hf_hub.js";
2 changes: 1 addition & 1 deletion packages/hub/src/lib/commit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe } from "vitest";

import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../consts";
import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../test/consts";
import type { RepoId } from "../types/public";
import type { CommitFile } from "./commit";
import { commit } from "./commit";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/create-repo.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe, expect } from "vitest";

import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../consts";
import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../test/consts";
import { insecureRandomString } from "../utils/insecureRandomString";
import { createRepo } from "./create-repo";
import { deleteRepo } from "./delete-repo";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/delete-file.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe } from "vitest";

import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../consts";
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";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/delete-files.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe } from "vitest";

import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../consts";
import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../test/consts";
import type { RepoId } from "../types/public";
import { insecureRandomString } from "../utils/insecureRandomString";
import { createRepo } from "./create-repo";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/upload-file.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe } from "vitest";

import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../consts";
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";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/upload-files-with-progress.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe } from "vitest";

import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../consts";
import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../test/consts";
import type { RepoId } from "../types/public";
import { insecureRandomString } from "../utils/insecureRandomString";
import { createRepo } from "./create-repo";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/upload-files.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert, it, describe } from "vitest";

import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../consts";
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";
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/who-am-i.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, it, describe } from "vitest";
import { TEST_ACCESS_TOKEN, TEST_HUB_URL } from "../consts";
import { TEST_ACCESS_TOKEN, TEST_HUB_URL } from "../test/consts";
import { whoAmI } from "./who-am-i";

describe("whoAmI", () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/hub/src/test/consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const TEST_HUB_URL = "https://hub-ci.huggingface.co";
export const TEST_USER = "hub.js";
export const TEST_ACCESS_TOKEN = "hf_hub.js";

0 comments on commit 95c509b

Please sign in to comment.