Skip to content

Commit d8b97d6

Browse files
committed
fix: lint and format in modelscope.test.ts
1 parent 5db55dd commit d8b97d6

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

apps/api/src/providers/__tests__/modelscope.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ describe('ModelScopeProvider', () => {
2121

2222
beforeEach(() => {
2323
vi.stubGlobal('fetch', vi.fn())
24-
;(provider as any).pollIntervalMs = 0
25-
;(provider as any).maxPollAttempts = 3
24+
const pollingConfig = provider as unknown as { pollIntervalMs: number; maxPollAttempts: number }
25+
pollingConfig.pollIntervalMs = 0
26+
pollingConfig.maxPollAttempts = 3
2627
})
2728

2829
afterEach(() => {
@@ -49,11 +50,11 @@ describe('ModelScopeProvider', () => {
4950
})
5051

5152
it('should throw AUTH_INVALID when token too short', async () => {
52-
await expect(provider.generate({ ...defaultRequest, authToken: 'short' })).rejects.toMatchObject(
53-
{
54-
code: ApiErrorCode.AUTH_INVALID,
55-
}
56-
)
53+
await expect(
54+
provider.generate({ ...defaultRequest, authToken: 'short' })
55+
).rejects.toMatchObject({
56+
code: ApiErrorCode.AUTH_INVALID,
57+
})
5758
})
5859
})
5960

@@ -156,7 +157,8 @@ describe('ModelScopeProvider', () => {
156157

157158
it('should throw TIMEOUT when polling exceeds attempts', async () => {
158159
const mockFetch = vi.mocked(fetch)
159-
;(provider as any).maxPollAttempts = 2
160+
const pollingConfig = provider as unknown as { maxPollAttempts: number }
161+
pollingConfig.maxPollAttempts = 2
160162

161163
mockFetch.mockResolvedValueOnce({
162164
ok: true,
@@ -177,4 +179,3 @@ describe('ModelScopeProvider', () => {
177179
})
178180
})
179181
})
180-

0 commit comments

Comments
 (0)