Repository navigation
test(signature-store): add unit tests for createSignatureStore and createThoughtBuffer - #551
Conversation
…eateThoughtBuffer Co-Authored-By: Giulio Vaccari <io@giuliovaccari.it>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
WalkthroughA new Vitest test file is introduced for validating signature and thought storage functionality. The tests verify that Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds a new test file ( Confidence Score: 5/5This PR is safe to merge — it only adds a new test file with no changes to production code. All 20 tests correctly match the TypeScript interfaces and the Map-backed implementation. No logic errors, no missing teardown concerns given the singleton tests don't mutate shared state, and the dynamic-import singleton check is valid under Vitest's default module caching within a test file. No files require special attention. Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class SignatureStore {
+get(key: string) SignedThinking | undefined
+set(key: string, value: SignedThinking) void
+has(key: string) boolean
+delete(key: string) void
}
class ThoughtBuffer {
+get(index: number) string | undefined
+set(index: number, text: string) void
+clear() void
}
class SignedThinking {
+text: string
+signature: string
}
class createSignatureStore {
<<factory>>
returns SignatureStore
}
class createThoughtBuffer {
<<factory>>
returns ThoughtBuffer
}
class defaultSignatureStore {
<<singleton>>
}
createSignatureStore --> SignatureStore
createThoughtBuffer --> ThoughtBuffer
SignatureStore --> SignedThinking
defaultSignatureStore --|> SignatureStore
Reviews (1): Last reviewed commit: "test(signature-store): add unit tests fo..." | Re-trigger Greptile |
Summary
Adds unit tests for
createSignatureStore,createThoughtBuffer, anddefaultSignatureStoreinsrc/plugin/stores/signature-store.test.ts.createSignatureStore(10 tests) — covers get/set/has/delete CRUD operations, key overwriting, store isolation between instances, empty-string keys, and collision-free storage across 50 keyscreateThoughtBuffer(8 tests) — covers numeric index get/set, clear (including no-op on empty), overwriting, buffer isolation between instances, and empty-string valuesdefaultSignatureStore(2 tests) — verifies the module-level singleton exposes the fullSignatureStoreinterface and returns the same reference on re-import