Files
ruflo/v3/@claude-flow/cli/src
Nicholas RuestandRuFlo 61d328278c fix(cli): remove vi.doMock race from doctor-memory-driver-3321 tests (#3552)
checkMemoryPersistenceDriver() now accepts an optional loadBetterSqlite3
dependency (default: the real dynamic import) instead of relying solely on
vi.doMock('better-sqlite3', ...) for fault injection. The mock-timing
approach raced beforeEach's real, unmocked driver init against the test's
mock registration — reliable in isolation but flaky under the full suite,
per #3552 ("expected 'pass' to be 'warn'").

Tests that fake the native driver now pass loadBetterSqlite3 straight into
checkMemoryPersistenceDriver(), removing the module-loader timing entirely.
vi.doMock is kept only where it still covers doctor's other checks during a
full runDoctor() pass (not the part that was flaking).

Verified 20/20 passing across 11 repeated runs, solo and alongside sibling
memory/doctor test files.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-30 13:46:05 -04:00
..
…
…