Commit Graph
2 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN ad4f04570c Add tests for lock-utils helpers
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]>
2026-02-20 18:05:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1926426b11 test: add missing error handling test for lock-utils
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]>
2026-02-17 18:53:34 +00:00