File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
packages/drivers/redis/test Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1010 build :
1111 runs-on : ubuntu-latest
1212 timeout-minutes : 15
13+ services :
14+ redis :
15+ image : redis
16+ ports :
17+ - 6379:6379
18+ options : >-
19+ --health-cmd "redis-cli ping"
20+ --health-interval 10s
21+ --health-timeout 5s
22+ --health-retries 5
1323 strategy :
1424 matrix :
1525 node-version : [18.x, 20.x]
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ describe('RedisDriver', () => {
1313
1414 beforeAll ( async ( ) => {
1515 let d : RedisDriver | undefined ;
16+ // Suppress console.error solely for the connection probe to avoid noise
17+ // when Redis is intentionaly missing (e.g. in some local envs)
18+ const consoleErrorSpy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
19+
1620 // Skip tests if Redis is not available
1721 try {
1822 d = new RedisDriver ( {
@@ -31,6 +35,9 @@ describe('RedisDriver', () => {
3135 // Ignore disconnect error
3236 }
3337 }
38+ } finally {
39+ // Restore console.error
40+ consoleErrorSpy . mockRestore ( ) ;
3441 }
3542 } ) ;
3643
You can’t perform that action at this time.
0 commit comments