From 9e3bc081b2b47450ecbb58607a32c17bf16b0583 Mon Sep 17 00:00:00 2001 From: Wauplin Date: Thu, 13 Nov 2025 15:56:34 +0100 Subject: [PATCH] Fix collection tests --- packages/hub/src/lib/collection-info.spec.ts | 18 +++++++++--------- packages/hub/src/lib/list-collections.spec.ts | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/hub/src/lib/collection-info.spec.ts b/packages/hub/src/lib/collection-info.spec.ts index 534ff5aa9e..b49b7bcdf9 100644 --- a/packages/hub/src/lib/collection-info.spec.ts +++ b/packages/hub/src/lib/collection-info.spec.ts @@ -37,12 +37,12 @@ describe("collectionInfo", () => { numRows: 38, viewer: "viewer", }, - downloads: 54013, + downloads: expect.any(Number), gated: false, id: "huggingfacejs/tasks", isLikedByUser: false, lastModified: "2025-05-21T10:59:37.000Z", - likes: 4, + likes: expect.any(Number), position: 0, private: false, repoType: "dataset", @@ -59,7 +59,7 @@ describe("collectionInfo", () => { _id: "6414d83b385a75d7790d5a58", avatarUrl: "https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png", - followerCount: 66, + followerCount: expect.any(Number), fullname: "Huggingface.js", isEnterprise: false, isHf: false, @@ -74,7 +74,7 @@ describe("collectionInfo", () => { theme: "pink", title: "Test Collection", type: "collection", - upvotes: 0, + upvotes: expect.any(Number), }, { _id: "690df2c49f252aa897a873b2", @@ -85,7 +85,7 @@ describe("collectionInfo", () => { _id: "6414d83b385a75d7790d5a58", avatarUrl: "https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png", - followerCount: 66, + followerCount: expect.any(Number), fullname: "Huggingface.js", isEnterprise: false, isHf: false, @@ -101,7 +101,7 @@ describe("collectionInfo", () => { id: "huggingfacejs/push-model-from-web", isLikedByUser: false, lastModified: "2023-04-01T15:29:38.000Z", - likes: 1, + likes: expect.any(Number), pinned: false, position: 2, private: false, @@ -142,7 +142,7 @@ describe("collectionInfo", () => { _id: "6414d83b385a75d7790d5a58", avatarUrl: "https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png", - followerCount: 66, + followerCount: expect.any(Number), fullname: "Huggingface.js", isEnterprise: false, isHf: false, @@ -152,12 +152,12 @@ describe("collectionInfo", () => { type: "org", }, availableInferenceProviders: [], - downloads: 0, + downloads: expect.any(Number), gated: false, id: "huggingfacejs/test-model", isLikedByUser: false, lastModified: "2025-11-07T13:25:23.000Z", - likes: 0, + likes: expect.any(Number), position: 4, private: false, repoType: "model", diff --git a/packages/hub/src/lib/list-collections.spec.ts b/packages/hub/src/lib/list-collections.spec.ts index fe13e31386..40d3daf6fb 100644 --- a/packages/hub/src/lib/list-collections.spec.ts +++ b/packages/hub/src/lib/list-collections.spec.ts @@ -47,12 +47,12 @@ describe("listCollections", () => { numRows: 38, viewer: "viewer", }, - downloads: 54013, + downloads: expect.any(Number), gated: false, id: "huggingfacejs/tasks", isLikedByUser: false, lastModified: "2025-05-21T10:59:37.000Z", - likes: 4, + likes: expect.any(Number), position: 0, private: false, repoType: "dataset", @@ -69,7 +69,7 @@ describe("listCollections", () => { _id: "6414d83b385a75d7790d5a58", avatarUrl: "https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png", - followerCount: 66, + followerCount: expect.any(Number), fullname: "Huggingface.js", isEnterprise: false, isHf: false, @@ -84,7 +84,7 @@ describe("listCollections", () => { theme: "pink", title: "Test Collection", type: "collection", - upvotes: 0, + upvotes: expect.any(Number), }, { _id: "690df2c49f252aa897a873b2", @@ -95,7 +95,7 @@ describe("listCollections", () => { _id: "6414d83b385a75d7790d5a58", avatarUrl: "https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png", - followerCount: 66, + followerCount: expect.any(Number), fullname: "Huggingface.js", isEnterprise: false, isHf: false, @@ -111,7 +111,7 @@ describe("listCollections", () => { id: "huggingfacejs/push-model-from-web", isLikedByUser: false, lastModified: "2023-04-01T15:29:38.000Z", - likes: 1, + likes: expect.any(Number), pinned: false, position: 2, private: false,