@@ -122,7 +122,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => {
122122
123123 it ( "should start redis with custom command" , async ( ) => {
124124 const container = new RedisContainer ( IMAGE ) . withCommand ( [ "redis-server" , "--loglevel" , "verbose" ] ) ;
125- const startedContainer = await container . start ( ) ;
125+ await using startedContainer = await container . start ( ) ;
126126
127127 // @ts -expect-error - accessing private property for testing
128128 expect ( container . createOpts . Cmd ) . toEqual ( [ "redis-server" , "--loglevel" , "verbose" ] ) ;
@@ -138,7 +138,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => {
138138
139139 it ( "should start redis-stack with custom env" , async ( ) => {
140140 const container = new RedisContainer ( REDISSTACK_IMAGE ) . withEnvironment ( { REDIS_ARGS : "--loglevel verbose" } ) ;
141- const startedContainer = await container . start ( ) ;
141+ await using startedContainer = await container . start ( ) ;
142142
143143 // @ts -expect-error - accessing private property for testing
144144 expect ( container . createOpts . Env ) . toEqual ( [ "REDIS_ARGS=--loglevel verbose" ] ) ;
@@ -158,7 +158,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => {
158158 const container = new RedisContainer ( IMAGE )
159159 . withCommand ( [ "redis-server" , "--loglevel" , "verbose" ] )
160160 . withPersistence ( sourcePath ) ;
161- const startedContainer = await container . start ( ) ;
161+ await using startedContainer = await container . start ( ) ;
162162
163163 // @ts -expect-error - accessing private property for testing
164164 expect ( container . createOpts . Cmd ) . toEqual ( [
@@ -185,7 +185,7 @@ describe("RedisContainer", { timeout: 240_000 }, () => {
185185 const container = new RedisContainer ( REDISSTACK_IMAGE )
186186 . withEnvironment ( { REDIS_ARGS : "--loglevel verbose" } )
187187 . withPersistence ( sourcePath ) ;
188- const startedContainer = await container . start ( ) ;
188+ await using startedContainer = await container . start ( ) ;
189189
190190 // @ts -expect-error - accessing private property for testing
191191 expect ( container . createOpts . Env ) . toEqual ( [ "REDIS_ARGS=--loglevel verbose --save 1 1 --appendonly yes" ] ) ;
0 commit comments