Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ioredis-mock #201

Closed
germanescobar opened this issue Dec 31, 2023 · 4 comments · Fixed by #219
Closed

Support for ioredis-mock #201

germanescobar opened this issue Dec 31, 2023 · 4 comments · Fixed by #219

Comments

@germanescobar
Copy link

Hi,

I have a case in which I need to pass an ioredis-mock instance for testing but I get the following error:

"client" must be instance of ioredis client or cluster

Is there a solution or workaround for this case?

Thanks!

@germanescobar germanescobar changed the title Support ioredis-mock Support for ioredis-mock Dec 31, 2023
@jokester
Copy link
Contributor

I had similar questions too. Is it really necessary to require a strict ioredis instance?

In my case I wanted to pass a duck-type compatible client, backed by redis-over-http client

@jokester
Copy link
Contributor

If maintainers thinks it's fine I'm happy to do something. I personally wanted a mutex that work with Upstash serverless redis.

The idea on my head is, to extract a ioredis-like interface and rely on the interface instead of instanceof check. Since only a few Redis APIs are required, I imagine the interface to be small. Other redis clients, even if they happen to name APIs differently, can be used with an adapter.

@swarthy
Copy link
Owner

swarthy commented May 21, 2024

@jokester Hi! PR is welcome

@swarthy
Copy link
Owner

swarthy commented May 26, 2024

Support for ioredis-mock added in v5.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants