Repository navigation
Fail when a sample note drifts from the cache snapshot - #80
Merged
Merged
Conversation
The real-cache tests read note text from obsidian-cache.json, so a sample note edited, added or removed without recapturing would leave them checking old text and still passing. Compare the notes in test-vault/Cache samples/ with the snapshot and point to the recapture steps when they differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
What changed
tests/obsidian-cache.test.tscompares the notes intest-vault/Cache samples/withtests/fixtures/obsidian-cache.json. It fails if a note was added, removed or changed since the snapshot, and its message points to the recapture steps.tests/fixtures/README.mdsays thatnpm testfails until you recapture.Why
The real-cache and write-back tests read note text from the snapshot, not from the vault. A sample note edited without recapturing would leave every test passing against the old text, while the note and the fixture quietly drift apart.
Checked
markers.mdfails with "markers.md changed since the snapshot…".new.mdfails with "sample notes were added or removed…".npm run build,npm run lintandnpm testpass (2,495 tests).Tests only; nothing changes for users.
🤖 Generated with Claude Code