Skip to content

Commit e495f15

Browse files
authored
Fix collection tests (#1842)
Expectation: CI should be green.
1 parent a757f69 commit e495f15

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

packages/hub/src/lib/collection-info.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ describe("collectionInfo", () => {
3737
numRows: 38,
3838
viewer: "viewer",
3939
},
40-
downloads: 54013,
40+
downloads: expect.any(Number),
4141
gated: false,
4242
id: "huggingfacejs/tasks",
4343
isLikedByUser: false,
4444
lastModified: "2025-05-21T10:59:37.000Z",
45-
likes: 4,
45+
likes: expect.any(Number),
4646
position: 0,
4747
private: false,
4848
repoType: "dataset",
@@ -59,7 +59,7 @@ describe("collectionInfo", () => {
5959
_id: "6414d83b385a75d7790d5a58",
6060
avatarUrl:
6161
"https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png",
62-
followerCount: 66,
62+
followerCount: expect.any(Number),
6363
fullname: "Huggingface.js",
6464
isEnterprise: false,
6565
isHf: false,
@@ -74,7 +74,7 @@ describe("collectionInfo", () => {
7474
theme: "pink",
7575
title: "Test Collection",
7676
type: "collection",
77-
upvotes: 0,
77+
upvotes: expect.any(Number),
7878
},
7979
{
8080
_id: "690df2c49f252aa897a873b2",
@@ -85,7 +85,7 @@ describe("collectionInfo", () => {
8585
_id: "6414d83b385a75d7790d5a58",
8686
avatarUrl:
8787
"https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png",
88-
followerCount: 66,
88+
followerCount: expect.any(Number),
8989
fullname: "Huggingface.js",
9090
isEnterprise: false,
9191
isHf: false,
@@ -101,7 +101,7 @@ describe("collectionInfo", () => {
101101
id: "huggingfacejs/push-model-from-web",
102102
isLikedByUser: false,
103103
lastModified: "2023-04-01T15:29:38.000Z",
104-
likes: 1,
104+
likes: expect.any(Number),
105105
pinned: false,
106106
position: 2,
107107
private: false,
@@ -142,7 +142,7 @@ describe("collectionInfo", () => {
142142
_id: "6414d83b385a75d7790d5a58",
143143
avatarUrl:
144144
"https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png",
145-
followerCount: 66,
145+
followerCount: expect.any(Number),
146146
fullname: "Huggingface.js",
147147
isEnterprise: false,
148148
isHf: false,
@@ -152,12 +152,12 @@ describe("collectionInfo", () => {
152152
type: "org",
153153
},
154154
availableInferenceProviders: [],
155-
downloads: 0,
155+
downloads: expect.any(Number),
156156
gated: false,
157157
id: "huggingfacejs/test-model",
158158
isLikedByUser: false,
159159
lastModified: "2025-11-07T13:25:23.000Z",
160-
likes: 0,
160+
likes: expect.any(Number),
161161
position: 4,
162162
private: false,
163163
repoType: "model",

packages/hub/src/lib/list-collections.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ describe("listCollections", () => {
4747
numRows: 38,
4848
viewer: "viewer",
4949
},
50-
downloads: 54013,
50+
downloads: expect.any(Number),
5151
gated: false,
5252
id: "huggingfacejs/tasks",
5353
isLikedByUser: false,
5454
lastModified: "2025-05-21T10:59:37.000Z",
55-
likes: 4,
55+
likes: expect.any(Number),
5656
position: 0,
5757
private: false,
5858
repoType: "dataset",
@@ -69,7 +69,7 @@ describe("listCollections", () => {
6969
_id: "6414d83b385a75d7790d5a58",
7070
avatarUrl:
7171
"https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png",
72-
followerCount: 66,
72+
followerCount: expect.any(Number),
7373
fullname: "Huggingface.js",
7474
isEnterprise: false,
7575
isHf: false,
@@ -84,7 +84,7 @@ describe("listCollections", () => {
8484
theme: "pink",
8585
title: "Test Collection",
8686
type: "collection",
87-
upvotes: 0,
87+
upvotes: expect.any(Number),
8888
},
8989
{
9090
_id: "690df2c49f252aa897a873b2",
@@ -95,7 +95,7 @@ describe("listCollections", () => {
9595
_id: "6414d83b385a75d7790d5a58",
9696
avatarUrl:
9797
"https://cdn-avatars.huggingface.co/v1/production/uploads/1679315631188-61d2f90c3c2083e1c08af22d.png",
98-
followerCount: 66,
98+
followerCount: expect.any(Number),
9999
fullname: "Huggingface.js",
100100
isEnterprise: false,
101101
isHf: false,
@@ -111,7 +111,7 @@ describe("listCollections", () => {
111111
id: "huggingfacejs/push-model-from-web",
112112
isLikedByUser: false,
113113
lastModified: "2023-04-01T15:29:38.000Z",
114-
likes: 1,
114+
likes: expect.any(Number),
115115
pinned: false,
116116
position: 2,
117117
private: false,

0 commit comments

Comments
 (0)