Skip to content

Commit 8acc8ec

Browse files
committed
fix(test): use zero retries for error handling test
The upload error test was flaky because pRetry now tracks the latest error (not the first). With retries enabled, nock's single interceptor gets consumed on the first attempt, causing retry attempts to throw Nock: No match instead of ResponseError.
1 parent 16aa847 commit 8acc8ec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/unit/socket-sdk-upload.test.mts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ describe('SocketSdk - Upload Manifest', () => {
379379
'should handle errors in uploadManifestFiles',
380380
{ retry: 2 },
381381
async () => {
382+
const noRetrySdk = new SocketSdk('test-token', {
383+
...FAST_TEST_CONFIG,
384+
retries: 0,
385+
})
386+
382387
nock('https://api.socket.dev')
383388
.post('/v0/orgs/test-org/upload-manifest-files')
384389
.reply(400, {
@@ -387,7 +392,7 @@ describe('SocketSdk - Upload Manifest', () => {
387392
},
388393
})
389394

390-
const result = await sdk.uploadManifestFiles('test-org', [
395+
const result = await noRetrySdk.uploadManifestFiles('test-org', [
391396
packageJsonPath,
392397
])
393398

0 commit comments

Comments
 (0)