File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
packages/drivers/redis/test Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -12,16 +12,25 @@ describe('RedisDriver', () => {
1212 const TEST_OBJECT = 'test_users' ;
1313
1414 beforeAll ( async ( ) => {
15+ let d : RedisDriver | undefined ;
1516 // Skip tests if Redis is not available
1617 try {
17- driver = new RedisDriver ( {
18- url : process . env . REDIS_URL || 'redis://localhost :6379'
18+ d = new RedisDriver ( {
19+ url : process . env . REDIS_URL || 'redis://127.0.0.1 :6379'
1920 } ) ;
2021
2122 // Verify connection by attempting a simple operation
22- await driver . count ( '_test_connection' , [ ] ) ;
23+ await d . count ( '_test_connection' , [ ] ) ;
24+ driver = d ;
2325 } catch ( error ) {
2426 console . warn ( 'Redis not available, skipping tests' ) ;
27+ if ( d ) {
28+ try {
29+ await d . disconnect ( ) ;
30+ } catch ( e ) {
31+ // Ignore disconnect error
32+ }
33+ }
2534 }
2635 } ) ;
2736
You can’t perform that action at this time.
0 commit comments