feat: add data integrity tests and persistence utilities (#96)#142
Open
feat: add data integrity tests and persistence utilities (#96)#142
Conversation
Add comprehensive tests for previously untested type functions and extract persistence logic into testable pure functions. - Add 14 tests for createPathOrganizer, createLocationEntry, getEntryIndexFromArray, isOldEntry - Create persistenceUtils.ts with parseDayLogJson, serializeDayLog, parseWeauditFile, serializeWeauditFile - Add 13 tests for persistence utilities covering parsing, serialization, and roundtrips - Refactor codeMarker.ts to use the new persistence utilities Total: 149 passing tests (27 new) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract pure functions from codeMarker.ts into testable utility modules: - entryUtils.ts: entry CRUD operations (remove, add, restore) - locationUtils.ts: location matching and filtering - auditingUtils.ts: region overlap, merge, and split algorithms Add 50 unit tests covering entry lifecycle, location management, and file auditing functionality. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Member
Author
Phase 2: Entry Lifecycle TestsThis PR now includes Phase 2 implementation adding 50 new unit tests for entry lifecycle operations. New Utility Modules
What was extractedEntry CRUD (
Location Management (
Auditing (
codeMarker.ts updatesRefactored these methods to use the new utilities:
Test results199 tests passing (149 existing + 50 new) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
types.ts:createPathOrganizer,createLocationEntry,getEntryIndexFromArray,isOldEntrypersistenceUtils.tsmodule with pure parsing/serialization functions for day logs and.weauditfilescodeMarker.tsto use the new persistence utilities, improving testabilityTest plan
npm test)🤖 Generated with Claude Code