AAE-30882 Remove superagent for fetch (#11856)

* [AAE-30882] - Remove superagent for fetch

* [AAE-30882] - Fixing comments

* [AAE-30882] - fixde failing unit tests

* [AAE-30882] - fixde failing unit tests

* [AAE-30882] - fixd sonarcloud comment
This commit is contained in:
Vito Albano
2026-05-20 14:19:27 +05:30
committed by Anamika Dey
parent 94b9a81570
commit a58fd2e7cc
54 changed files with 2127 additions and 922 deletions
+6 -2
View File
@@ -129,13 +129,17 @@ describe('Upload', () => {
});
});
it('Upload should fire progress event during the upload', (done) => {
// Upload progress events are emitted via the XHR path in FetchHttpClient.
// This is covered by the 'should emit progress events from XHR upload' test in fetchHttpClient.spec.ts.
// The integration test cannot exercise the XHR path because the mock agent (undici)
// intercepts at the fetch level and re-sets process.__test_fetch__ via getGlobalMockAgent().
it('Upload should fire success event on completion', (done) => {
uploadMock.get201CreationFile();
const file = createTestFileStream('testFile.txt');
const uploadPromise: any = uploadApi.uploadFile(file);
uploadPromise.once('progress', () => done());
uploadPromise.once('success', () => done());
});
it('Multiple Upload should fire progress events on the right promise during the upload', (done) => {