@@ -13,14 +13,15 @@ import type { GameCode, GameID, GameString } from '../Types/Game.js';
1313
1414test ( 'Invalid Guild Type' , async ( ) => {
1515 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
16- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1717 // @ts -expect-error
1818 await expect ( ( ) => client . getGuild ( 'invalid' , 'invalid' ) ) . rejects . toThrowError ( Errors . INVALID_GUILD_SEARCH_PARAMETER ) ;
1919 client . destroy ( ) ;
2020} ) ;
2121
2222test ( 'Invalid Guild' , async ( ) => {
2323 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
24+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
2425 await expect ( ( ) => client . getGuild ( 'name' , 'this guild dose not exist' ) ) . rejects . toThrowError (
2526 Errors . GUILD_DOES_NOT_EXIST
2627 ) ;
@@ -29,20 +30,22 @@ test('Invalid Guild', async () => {
2930
3031test ( 'Invalid Guild ID' , async ( ) => {
3132 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
33+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
3234 await expect ( ( ) => client . getGuild ( 'id' , 'invalid guild id' ) ) . rejects . toThrowError ( Errors . INVALID_GUILD_ID ) ;
3335 client . destroy ( ) ;
3436} ) ;
3537
3638test ( 'No Guild Query' , async ( ) => {
3739 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
38- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
40+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3941 // @ts -expect-error
4042 await expect ( ( ) => client . getGuild ( 'id' ) ) . rejects . toThrowError ( Errors . NO_GUILD_QUERY ) ;
4143 client . destroy ( ) ;
4244} ) ;
4345
4446test ( 'User not in a guild' , async ( ) => {
4547 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
48+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
4649 const data = await client . getGuild ( 'player' , '37501e7512b845ab8796e2baf9e9677a' ) ;
4750 expect ( data ) . toBeDefined ( ) ;
4851 expectTypeOf ( data ) . toEqualTypeOf < Guild | null | RequestData > ( ) ;
@@ -51,6 +54,7 @@ test('User not in a guild', async () => {
5154
5255test ( 'getGuild (raw)' , async ( ) => {
5356 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
57+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
5458 const data = await client . getGuild ( 'name' , 'Pixelic' , { raw : true } ) ;
5559 expect ( data ) . toBeDefined ( ) ;
5660 expect ( data ) . toBeInstanceOf ( RequestData ) ;
@@ -62,6 +66,7 @@ test('getGuild (raw)', async () => {
6266
6367test ( 'getGuild (Name)' , async ( ) => {
6468 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
69+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
6570 const data = await client . getGuild ( 'name' , 'Pixelic' ) ;
6671 expect ( data ) . toBeDefined ( ) ;
6772 expect ( data ) . toBeInstanceOf ( Guild ) ;
@@ -246,6 +251,7 @@ test('getGuild (Name)', async () => {
246251
247252test ( 'getGuild (Id)' , async ( ) => {
248253 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
254+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
249255 const data = await client . getGuild ( 'id' , '64b54f9d8ea8c96aaedafe84' ) ;
250256 expect ( data ) . toBeDefined ( ) ;
251257 expect ( data ) . toBeInstanceOf ( Guild ) ;
@@ -430,6 +436,7 @@ test('getGuild (Id)', async () => {
430436
431437test ( 'getGuild (Player)' , async ( ) => {
432438 const client = new Client ( process . env . HYPIXEL_KEY ?? '' , { cache : false , checkForUpdates : false , rateLimit : 'NONE' } ) ;
439+ client . requestHandler . setBaseURL ( process . env . HYPIXEL_URL ) ;
433440 const data = await client . getGuild ( 'player' , '14727faefbdc4aff848cd2713eb9939e' ) ;
434441 expect ( data ) . toBeDefined ( ) ;
435442 expect ( data ) . toBeInstanceOf ( Guild ) ;
0 commit comments