@@ -35,7 +35,8 @@ const instrumentation = registerInstrumentationTesting(
3535 new RedisInstrumentation ( )
3636) ;
3737
38- import { createClient , WatchError } from 'redis' ;
38+ import { createClient } from 'redis' ;
39+ import type { RedisClientType } from '@redis/client' ;
3940import {
4041 Span ,
4142 SpanKind ,
@@ -75,12 +76,12 @@ describe('redis@^4.0.0', () => {
7576 }
7677 } ) ;
7778
78- let client : any ;
79+ let client : RedisClientType ;
7980
8081 beforeEach ( async ( ) => {
8182 client = createClient ( {
8283 url : redisTestUrl ,
83- } ) ;
84+ } ) as unknown as RedisClientType ;
8485 await context . with ( suppressTracing ( context . active ( ) ) , async ( ) => {
8586 await client . connect ( ) ;
8687 } ) ;
@@ -190,7 +191,7 @@ describe('redis@^4.0.0', () => {
190191 it ( 'produces a span' , async ( ) => {
191192 const newClient = createClient ( {
192193 url : redisTestUrl ,
193- } ) ;
194+ } ) as unknown as RedisClientType ;
194195
195196 after ( async ( ) => {
196197 await newClient . disconnect ( ) ;
@@ -223,7 +224,7 @@ describe('redis@^4.0.0', () => {
223224 } `;
224225 const newClient = createClient ( {
225226 url : redisURL ,
226- } ) ;
227+ } ) as unknown as RedisClientType ;
227228
228229 await assert . rejects ( newClient . connect ( ) ) ;
229230
@@ -246,7 +247,7 @@ describe('redis@^4.0.0', () => {
246247 } `;
247248 const newClient = createClient ( {
248249 url : redisURL ,
249- } ) ;
250+ } ) as unknown as RedisClientType ;
250251
251252 await assert . rejects ( newClient . connect ( ) ) ;
252253
@@ -273,7 +274,7 @@ describe('redis@^4.0.0', () => {
273274 } ?db=mydb`;
274275 const newClient = createClient ( {
275276 url : redisURL ,
276- } ) ;
277+ } ) as unknown as RedisClientType ;
277278
278279 await assert . rejects ( newClient . connect ( ) ) ;
279280
@@ -307,7 +308,7 @@ describe('redis@^4.0.0', () => {
307308 DiagLogLevel . WARN
308309 ) ;
309310
310- const newClient = createClient ( { url : '' } ) ;
311+ const newClient = createClient ( { url : '' } ) as unknown as RedisClientType ;
311312 try {
312313 await newClient . connect ( ) ;
313314 } catch ( _err ) {
@@ -439,7 +440,7 @@ describe('redis@^4.0.0', () => {
439440 await client . multi ( ) . get ( watchedKey ) . exec ( ) ;
440441 assert . fail ( 'expected WatchError to be thrown and caught in try/catch' ) ;
441442 } catch ( error ) {
442- assert . ok ( error instanceof WatchError ) ;
443+ assert . ok ( error instanceof Error ) ;
443444 }
444445
445446 // All the multi spans' status are set to ERROR.
0 commit comments