fix: tests
This commit is contained in:
parent
25a0c14be8
commit
276a286853
@ -325,7 +325,10 @@ describe('models service', () => {
|
|||||||
|
|
||||||
expect(result).toEqual(mockRepoData)
|
expect(result).toEqual(mockRepoData)
|
||||||
expect(fetch).toHaveBeenCalledWith(
|
expect(fetch).toHaveBeenCalledWith(
|
||||||
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true'
|
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true',
|
||||||
|
{
|
||||||
|
headers: {},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -341,19 +344,28 @@ describe('models service', () => {
|
|||||||
'https://huggingface.co/microsoft/DialoGPT-medium'
|
'https://huggingface.co/microsoft/DialoGPT-medium'
|
||||||
)
|
)
|
||||||
expect(fetch).toHaveBeenCalledWith(
|
expect(fetch).toHaveBeenCalledWith(
|
||||||
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true'
|
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true',
|
||||||
|
{
|
||||||
|
headers: {},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test with domain prefix
|
// Test with domain prefix
|
||||||
await fetchHuggingFaceRepo('huggingface.co/microsoft/DialoGPT-medium')
|
await fetchHuggingFaceRepo('huggingface.co/microsoft/DialoGPT-medium')
|
||||||
expect(fetch).toHaveBeenCalledWith(
|
expect(fetch).toHaveBeenCalledWith(
|
||||||
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true'
|
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true',
|
||||||
|
{
|
||||||
|
headers: {},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test with trailing slash
|
// Test with trailing slash
|
||||||
await fetchHuggingFaceRepo('microsoft/DialoGPT-medium/')
|
await fetchHuggingFaceRepo('microsoft/DialoGPT-medium/')
|
||||||
expect(fetch).toHaveBeenCalledWith(
|
expect(fetch).toHaveBeenCalledWith(
|
||||||
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true'
|
'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true',
|
||||||
|
{
|
||||||
|
headers: {},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -379,7 +391,10 @@ describe('models service', () => {
|
|||||||
|
|
||||||
expect(result).toBeNull()
|
expect(result).toBeNull()
|
||||||
expect(fetch).toHaveBeenCalledWith(
|
expect(fetch).toHaveBeenCalledWith(
|
||||||
'https://huggingface.co/api/models/nonexistent/model?blobs=true'
|
'https://huggingface.co/api/models/nonexistent/model?blobs=true',
|
||||||
|
{
|
||||||
|
headers: {},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user