We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi dear friends,
I want to know what is the right way to test the error result, In my test code I use
jest.mock("redis", () => jest.requireActual("redis-mock")); describe("redis functions tests OK", () => {......}
But always I can test the success results very easy, for example:
const set = (key, data, dbOptions) => new Promise((resolve, reject) => createClient(dbOptions) .then((client) => client.set(key, data, (err, res) => (err ? reject(err) : resolve(res))) ) .catch(reject) );
This, works fine.
it("set success", async () => await expect(redisFunctions.set("key", "hello", dbOptions)).resolves.toBe( "OK" ));
But, I don't know how to return an Error in client.set(key, data, (err, res) using redis-mock with the current configuration.
client.set(key, data, (err, res)
Thanks for your help.
The text was updated successfully, but these errors were encountered:
Would be cool to have this feature, so I can test error paths in the code
Sorry, something went wrong.
No branches or pull requests
Hi dear friends,
I want to know what is the right way to test the error result, In my test code I use
But always I can test the success results very easy, for example:
This, works fine.
But, I don't know how to return an Error in
client.set(key, data, (err, res)
using redis-mock with the current configuration.Thanks for your help.
The text was updated successfully, but these errors were encountered: