Handle breaking changes in nock 15.0.0 (encapsulates replyWithError response in object)

This commit is contained in:
Jerome Prinet 2025-10-30 12:40:04 +01:00
parent 1ed61ac712
commit 3709737ee5
No known key found for this signature in database
GPG Key ID: 101BA71B2F530F0A

View File

@ -65,10 +65,9 @@ describe('retry', () => {
nock('https://services.gradle.org', {allowUnmocked: true})
.get('/versions/all')
.times(3)
.replyWithError({
message: 'connect ECONNREFUSED 104.18.191.9:443',
code: 'ECONNREFUSED'
})
.replyWithError(
Object.assign(new Error('Connection refused'), { code: 'ECONNREFUSED' }),
)
const validChecksums = await checksums.fetchUnknownChecksums(false, knownChecksumsWithout8_1())
expect(validChecksums.checksums.size).toBeGreaterThan(0)