mirror of
https://github.com/gradle/wrapper-validation-action
synced 2024-11-24 01:22:01 +00:00
29 lines
813 B
TypeScript
29 lines
813 B
TypeScript
import * as checksums from '../src/checksums'
|
|
import nock from 'nock'
|
|
|
|
test('fetches wrapper jars checksums', async () => {
|
|
const validChecksums = await checksums.fetchValidChecksums(false)
|
|
expect(validChecksums.length).toBeGreaterThan(10)
|
|
})
|
|
|
|
describe('retry', () => {
|
|
afterEach(() => {
|
|
nock.cleanAll()
|
|
})
|
|
|
|
describe('for /versions/all API', () => {
|
|
test('retry three times', async () => {
|
|
nock('https://services.gradle.org', {allowUnmocked: true})
|
|
.get('/versions/all')
|
|
.times(3)
|
|
.replyWithError({
|
|
message: 'connect ECONNREFUSED 104.18.191.9:443',
|
|
code: 'ECONNREFUSED'
|
|
})
|
|
|
|
const validChecksums = await checksums.fetchValidChecksums(false)
|
|
expect(validChecksums.length).toBeGreaterThan(10)
|
|
nock.isDone()
|
|
})
|
|
})
|
|
})
|