mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
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:
@@ -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 () => {
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -15,6 +15,7 @@ beforeEach(() => {
|
||||
setGlobalDispatcher(mockAgent);
|
||||
|
||||
mockPool = mockAgent.get('https://discord.com');
|
||||
api.setAgent(mockAgent);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user