mirror of https://github.com/actions/toolkit
testing reject after timeout
parent
7f47ffaee2
commit
9d70b8a9fb
|
@ -309,6 +309,8 @@ describe('download-artifact', () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try {
|
||||||
await downloadArtifactPublic(
|
await downloadArtifactPublic(
|
||||||
fixtures.artifactID,
|
fixtures.artifactID,
|
||||||
fixtures.repositoryOwner,
|
fixtures.repositoryOwner,
|
||||||
|
@ -339,35 +341,10 @@ describe('download-artifact', () => {
|
||||||
fixtures.blobStorageUrl
|
fixtures.blobStorageUrl
|
||||||
)
|
)
|
||||||
expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5)
|
expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5)
|
||||||
// const mockHttpClient = (HttpClient as jest.Mock).mockImplementation(
|
} catch (err) {
|
||||||
// () => {
|
// eslint-disable-next-line no-console
|
||||||
// return {
|
console.log(err)
|
||||||
// get: mockDelayBlobResponse
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
|
|
||||||
// expect(downloadArtifactMock).toHaveBeenCalledWith({
|
|
||||||
// owner: fixtures.repositoryOwner,
|
|
||||||
// repo: fixtures.repositoryName,
|
|
||||||
// artifact_id: fixtures.artifactID,
|
|
||||||
// archive_format: 'zip',
|
|
||||||
// request: {
|
|
||||||
// redirect: 'manual'
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString())
|
|
||||||
// expect(mockGetArtifactFailure).toHaveBeenCalledWith(
|
|
||||||
// fixtures.blobStorageUrl
|
|
||||||
// )
|
|
||||||
// await expect(
|
|
||||||
// downloadArtifactPublic(
|
|
||||||
// fixtures.artifactID,
|
|
||||||
// fixtures.repositoryOwner,
|
|
||||||
// fixtures.repositoryName,
|
|
||||||
// fixtures.token
|
|
||||||
// )
|
|
||||||
// ).rejects.toBeInstanceOf(Error)
|
|
||||||
}, 40000)
|
}, 40000)
|
||||||
it('should fail if blob storage response is non-200 after 5 retries', async () => {
|
it('should fail if blob storage response is non-200 after 5 retries', async () => {
|
||||||
const downloadArtifactMock = github.getOctokit(fixtures.token).rest
|
const downloadArtifactMock = github.getOctokit(fixtures.token).rest
|
||||||
|
|
Loading…
Reference in New Issue