mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
refactor(REST): remove double classing (#9722)
* refactor(REST): remove double classing BREAKING CHANGE: `REST` and `RequestManager` have been combined, most of the properties, methods, and events from both classes can now be found on `REST` BREAKING CHANGE: `REST#raw` has been removed in favor of `REST#queueRequest` BREAKING CHANGE: `REST#getAgent` has been removed in favor of `REST#agent` * chore: update for /rest changes
This commit is contained in:
@@ -106,7 +106,7 @@ test('Significant Invalid Requests', async () => {
|
||||
await expect(e).rejects.toThrowError('Missing Permissions');
|
||||
expect(invalidListener).toHaveBeenCalledTimes(0);
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
api.requestManager.options.invalidRequestWarningInterval = 2;
|
||||
api.options.invalidRequestWarningInterval = 2;
|
||||
|
||||
const [f, g, h, i, j] = [
|
||||
api.get('/badRequest'),
|
||||
@@ -504,7 +504,7 @@ test('Unauthorized', async () => {
|
||||
.reply(401, { message: '401: Unauthorized', code: 0 }, responseOptions)
|
||||
.times(2);
|
||||
|
||||
const setTokenSpy = vitest.spyOn(invalidAuthApi.requestManager, 'setToken');
|
||||
const setTokenSpy = vitest.spyOn(invalidAuthApi, 'setToken');
|
||||
|
||||
// Ensure authless requests don't reset the token
|
||||
const promiseWithoutTokenClear = invalidAuthApi.get('/unauthorized', { auth: false });
|
||||
|
||||
Reference in New Issue
Block a user