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

fix(test): Fixed improper mocking of ioredis resources in unit tests #11

Merged
merged 6 commits into from
Jun 15, 2024

Conversation

rbonestell
Copy link
Contributor

I discovered after I woke up and saw PR #10 was approved and merged, that the output of the unit test runs included ioredis errors where it was attempting to connect to a redis host. I had improperly mocked only the functions I was testing in the Redis object and not all resources from ioredis. This fix resolves the issue and the tests still behave as desired.

  1. Updated unit.spec.ts to properly mock all ioredis resources using vitest.

… index which to use for single-instance configurations with cluster mode disabled
… and added details for configuring redlock to use a specific DB index for single instance with cluster mode disabled
…pec.ts to system.spec.ts to distinguish unit from system tests. Updated package.json accordingly.

Added system tests to cover use cases for configuring a specific DB number.
Added unit test coverage for Redlock settings and acquire, extend, and release methods.
…ttempting to connect to a redis host when instantiating an object of the Redis class
@rbonestell rbonestell marked this pull request as ready for review June 13, 2024 20:40
@djMax djMax merged commit d03b7f5 into sesamecare:main Jun 15, 2024
6 checks passed
Copy link

🎉 This PR is included in version 1.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants