Skip to content

fix(test): improve coverage for custom-tool-registry - #8

Closed
easonLiangWorldedtech wants to merge 7 commits into
mainfrom
fix-coverage-custom-tool-registry-20260726
Closed

fix(test): improve coverage for custom-tool-registry#8
easonLiangWorldedtech wants to merge 7 commits into
mainfrom
fix-coverage-custom-tool-registry-20260726

Conversation

@easonLiangWorldedtech

Copy link
Copy Markdown
Owner

This PR improves test coverage for custom-tool-registry.ts.

Changes

  • Added tests for getAllSerialized(): serialization of registered tools and empty case
  • Added tests for setExtensionPath/getExtensionPath: getter/setter with default, single set, and update scenarios
  • Added tests for clearCache(): clearing with existing cache dir and non-existent dir

Coverage Delta

File Before After
custom-tool-registry.ts 27.3% 76.86%

Test Results

All 24 tests pass (added 10 new test cases).

Files Changed

  • packages/core/src/custom-tools/__tests__/custom-tool-registry.spec.ts (+65 lines)

…nfiguration

Body: Implement generic request configuration builder with chainable methods (addAbortSignal, addHeaders, setOption), static factory methods (fromMetadata, mergeAbortSignals), and 40 unit tests.
…ls early-abort

- Fix README TOC: change #how-mergesignals-works to
  #how-mergeabortsignals-works to match the actual heading anchor
- Simplify mergeAbortSignals: return primarySignal directly when it's
  already aborted instead of creating a new AbortController
…onfigBuilder (Zoo-Code-Org#615)

- Add default empty object parameter to addHeaders() so calling with
  undefined no longer throws TypeError from Object.keys(undefined)
- Reorder mergeAbortSignals to check primarySignal.aborted before
  allocating AbortController, preventing unnecessary controller creation
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.

2 participants