File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11import { Request , Response , NextFunction , RequestHandler } from 'express' ;
22import { GraphQLSchema , buildSchema } from 'graphql' ;
3- import * as redis from 'redis' ;
4- import redisMock from 'redis-mock' ;
5- import { RedisClientType } from 'redis' ;
3+ import * as ioredis from 'ioredis' ;
4+
65import expressRateLimitMiddleware from '../../src/middleware/index' ;
76
7+ // eslint-disable-next-line @typescript-eslint/no-var-requires
8+ const RedisMock = require ( 'ioredis-mock' ) ;
9+
810let middleware : RequestHandler ;
911let mockRequest : Partial < Request > ;
1012let complexRequest : Partial < Request > ;
@@ -337,7 +339,7 @@ xdescribe('Express Middleware tests', () => {
337339 // We could use NODE_ENV varibale in the implementation to determine the connection type.
338340
339341 // TODO: connect to the actual redis client here. Make sure to disconnect for proper teardown
340- const client : RedisClientType = redisMock . createClient ( ) ;
342+ const client : ioredis . Redis = new RedisMock ( ) ;
341343 await client . connect ( ) ;
342344 // Check for change in the redis store for the IP key
343345
You can’t perform that action at this time.
0 commit comments