|  |  |  | @ -108,6 +108,24 @@ describe('ResponseQueue (persistent add)', () => { | 
		
	
		
			
				|  |  |  |  | }); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | describe('ResponseQueue (retries/backoff)', () => { | 
		
	
		
			
				|  |  |  |  |   beforeAll(() => { | 
		
	
		
			
				|  |  |  |  |     // Re-crear DB en memoria y reinyectar para este bloque
 | 
		
	
		
			
				|  |  |  |  |     testDb = new Database(':memory:'); | 
		
	
		
			
				|  |  |  |  |     initializeDatabase(testDb); | 
		
	
		
			
				|  |  |  |  |     originalDbInstance = (ResponseQueue as any).dbInstance; | 
		
	
		
			
				|  |  |  |  |     (ResponseQueue as any).dbInstance = testDb; | 
		
	
		
			
				|  |  |  |  |   }); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   afterAll(() => { | 
		
	
		
			
				|  |  |  |  |     (ResponseQueue as any).dbInstance = originalDbInstance; | 
		
	
		
			
				|  |  |  |  |     testDb.close(); | 
		
	
		
			
				|  |  |  |  |   }); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   beforeEach(() => { | 
		
	
		
			
				|  |  |  |  |     // Limpiar tabla entre tests
 | 
		
	
		
			
				|  |  |  |  |     testDb.exec('DELETE FROM response_queue'); | 
		
	
		
			
				|  |  |  |  |   }); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   function isoNow(): string { | 
		
	
		
			
				|  |  |  |  |     return new Date().toISOString().replace('T', ' ').replace('Z', ''); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
	
		
			
				
					|  |  |  | 
 |