fix(undiciRequest): file uploading (#11320)

* fix(undiciRequest): file uploading

* fix: different approach

* fix: revert to the previous approach

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Almeida
2025-12-03 14:40:15 +00:00
committed by GitHub
parent 633fdd8f28
commit 0aaba0305f
6 changed files with 19 additions and 1 deletions

View File

@@ -37,6 +37,8 @@ beforeEach(() => {
setGlobalDispatcher(mockAgent); // enabled the mock client to intercept requests
mockPool = mockAgent.get('https://discord.com');
api.setAgent(mockAgent);
fetchApi.setAgent(mockAgent);
});
afterEach(async () => {

View File

@@ -481,6 +481,8 @@ test('perm server outage', async () => {
test('server responding too slow', async () => {
const api2 = new REST({ timeout: 1 }).setToken('A-Very-Really-Real-Token');
api2.setAgent(mockAgent);
mockPool
.intercept({
path: genPath('/slow'),

View File

@@ -15,6 +15,7 @@ beforeEach(() => {
setGlobalDispatcher(mockAgent);
mockPool = mockAgent.get('https://discord.com');
api.setAgent(mockAgent);
});
afterEach(async () => {

View File

@@ -28,6 +28,7 @@ beforeEach(() => {
setGlobalDispatcher(mockAgent); // enabled the mock client to intercept requests
mockPool = mockAgent.get('https://discord.com');
api.setAgent(mockAgent);
});
afterEach(async () => {