Added comprehensive unit tests for `withTimeout`, `relayListLabel`, and `mergeRelayList` in `test/lock-utils.test.mjs`.
- `withTimeout`: Verified resolution, timeout rejection, and promise rejection.
- `relayListLabel`: Verified list joining and edge cases.
- `mergeRelayList`: Verified merging, deduplication, and empty list handling.
This improves code coverage and reliability for these utility functions.
Co-authored-by: PR0M3TH3AN <[email protected]>
Add a unit test for `getCompletedAgents` in `src/lock-utils.mjs` to verify that:
1. It correctly identifies completed agents.
2. It handles `ENOENT` gracefully (silent).
3. It logs an error for non-`ENOENT` errors (e.g. permission denied).
The `getCompletedAgents` function already supported dependency injection via a `deps` object, which is utilized in this test to mock `fs.readdir` and other dependencies.
Co-authored-by: PR0M3TH3AN <[email protected]>