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

Refactor Connection Management and Update Unit Tests for Improved Robustness #78

Merged
merged 8 commits into from
May 29, 2023

Conversation

jaakkos
Copy link
Owner

@jaakkos jaakkos commented May 28, 2023

This PR includes several key changes to the management of connections and the associated unit tests:

  1. Refactored Connection class into an abstract class with two concrete implementations - PlainConnection and SecureConnection. This allows better handling of different connection types and improves code readability and maintainability.

  2. Updated the Manager class to handle connection errors, retries, and logging better. This includes adding event listeners for various connection events and implementing a retry mechanism for retriable errors.

  3. Updated unit tests to reflect these changes and to better test the new logic. Tests now cover plain and secure connections and check the correct handling of log entries and queue flushing.

These changes are intended to improve the robustness of the connection management and to ensure that the system handles errors and retries appropriately.

@jaakkos jaakkos self-assigned this May 28, 2023
This commit includes several updates to the project:

1. Added a 'test:watch' script to package.json to enable running jest in watch mode.
2. Refactored the manager tests to improve readability and test coverage.
3. Updated the type of logQueue from a tuple to an Array in manager.ts.

These changes are intended to improve the developer experience and maintainability of the test suite.
@jaakkos jaakkos merged commit 15f3519 into main May 29, 2023
@jaakkos jaakkos deleted the feature/clean-up-for-new-features branch May 29, 2023 15:45
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 this pull request may close these issues.

1 participant