Skip to content

test: run the cache and recall unit tests CI never ran - #58

Merged
nTEG-dev merged 1 commit into
mainfrom
test/move-cache-recall-tests
Sep 23, 2026
Merged

nTEG-dev merged 1 commit into
mainfrom
test/move-cache-recall-tests

Conversation

@nTEG-dev

Copy link
Copy Markdown
Member

Run the cache and recall unit tests that CI never ran

src/services/cache.test.ts and src/tools/recall.test.ts live outside the unit config's include (tests/unit/**/*.test.ts). They have never run in CI. This PR moves them into tests/unit/ and repairs them so they pass.

Changes

  • Move: both files go to tests/unit/services/ and tests/unit/tools/, with imports pointed at ../../../src/....
  • recall.test.ts mocks: the tier mock used vi.fn().mockReturnValue(...) inside a hoisted vi.mock factory. The suite-wide clearMocks stripped those implementations, so hasSupabase() returned undefined and recall silently took its free-tier branch. The factories are now plain functions.
  • recall.test.ts isolation: local-vector-search is mocked as not ready, so recall takes the Supabase branch the tests assert on. supabase-client gains the exports recall now calls.
  • Assertions: two assertions now match current output: "1 scar to review", and the rewritten empty-state copy.

Evidence

Check Result
The two moved files 36/36 pass (cache 26, recall 10)
Unit suite 1437/1437 (was 1401; +36, nothing else changed)
tsc clean

These edits were uncommitted work from 2026-08-08 in a local worktree. Test-only change, so no version bump.

🤖 Generated with Claude Code

…ocks

src/services/cache.test.ts and src/tools/recall.test.ts sit outside the
unit config's include (tests/unit/**), so they never ran. Move them and
fix the imports. recall.test.ts: use plain-function mock factories (vi.fn
implementations were cleared by clearMocks, routing recall to the free
tier), mock local-vector-search to force the Supabase branch, and update
two copy assertions to current wording.

Tests: +36 now run (cache 26, recall 10); unit suite 1401 -> 1437, all pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nTEG-dev
nTEG-dev merged commit 9426eec into main Sep 23, 2026
7 checks passed
@nTEG-dev
nTEG-dev deleted the test/move-cache-recall-tests branch September 23, 2026 05:47
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.

1 participant