File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,9 +181,15 @@ export class CachedSettings
181181 const settings = _id . map ( ( id ) => this . store . get ( id ) ?. value ) ;
182182 callback ( settings as T [ ] ) ;
183183 }
184- const mergeFunction = _ . debounce ( ( ) : void => {
185- callback ( _id . map ( ( id ) => this . store . get ( id ) ?. value ) as T [ ] ) ;
186- } , 100 ) ;
184+
185+ const mergeFunction =
186+ process . env . TEST_MODE !== 'true'
187+ ? _ . debounce ( ( ) : void => {
188+ callback ( _id . map ( ( id ) => this . store . get ( id ) ?. value ) as T [ ] ) ;
189+ } , 100 )
190+ : ( ) : void => {
191+ callback ( _id . map ( ( id ) => this . store . get ( id ) ?. value ) as T [ ] ) ;
192+ } ;
187193
188194 const fns = _id . map ( ( id ) => this . on ( id , mergeFunction ) ) ;
189195 return ( ) : void => {
Original file line number Diff line number Diff line change @@ -260,15 +260,14 @@ describe('[CustomSounds]', () => {
260260 let gridFsFileId : string ;
261261
262262 before ( async ( ) => {
263+ await updateSetting ( 'CustomSounds_FileSystemPath' , '' , false ) ;
263264 await updateSetting ( 'CustomSounds_Storage_Type' , 'FileSystem' ) ;
264265 fsFileId = await insertOrUpdateSound ( `${ fileName } -3` ) ;
265266 await uploadCustomSound ( binary , `${ fileName } -3` , fsFileId ) ;
266267
267268 await updateSetting ( 'CustomSounds_Storage_Type' , 'GridFS' ) ;
268269 gridFsFileId = await insertOrUpdateSound ( `${ fileName } -4` ) ;
269270 await uploadCustomSound ( binary , `${ fileName } -4` , gridFsFileId ) ;
270-
271- await updateSetting ( 'CustomSounds_FileSystemPath' , '' ) ;
272271 } ) ;
273272
274273 after ( async ( ) => {
Original file line number Diff line number Diff line change @@ -497,13 +497,12 @@ describe('[EmojiCustom]', () => {
497497</svg>` ) ;
498498
499499 before ( async ( ) => {
500+ await updateSetting ( 'EmojiUpload_FileSystemPath' , '' , false ) ;
500501 await updateSetting ( 'EmojiUpload_Storage_Type' , 'FileSystem' ) ;
501502 await request . post ( api ( 'emoji-custom.create' ) ) . set ( credentials ) . attach ( 'emoji' , imgURL ) . field ( { name : fsEmojiName } ) . expect ( 200 ) ;
502503
503504 await updateSetting ( 'EmojiUpload_Storage_Type' , 'GridFS' ) ;
504505 await request . post ( api ( 'emoji-custom.create' ) ) . set ( credentials ) . attach ( 'emoji' , imgURL ) . field ( { name : gridFsEmojiName } ) . expect ( 200 ) ;
505-
506- await updateSetting ( 'EmojiUpload_FileSystemPath' , '' ) ;
507506 } ) ;
508507
509508 after ( async ( ) => {
You can’t perform that action at this time.
0 commit comments