Files
ruflo/archive/legacy-memory-system/test-setup.ts
T
rUvandClaude 5aada0b189 feat: complete SQLite memory system implementation for v2.0.4
This commit brings v2.0.4 changes to main without problematic SQLite database files:

### 🗄️ SQLite Memory System
- Enhanced SQLite Schema with 12 specialized tables
- Persistent storage in .swarm/memory.db with WAL mode
- Cross-session persistence for Claude Code sessions
- Namespace support for organized memory management

### 🔧 MCP Server Integration
- EnhancedMemory class extending SqliteMemoryStore
- 14 Hook types for comprehensive operation tracking
- Memory synchronization between CLI and MCP tools
- Robust error handling and database integrity

### 📁 Project Organization
- Archive legacy systems to archive/legacy-memory-system
- Clean root structure for better maintainability
- Updated documentation reflecting SQLite architecture

### 🔗 NPM Package Updates
- Include memory JS/SQL files in distribution
- MCP server files included in npm package
- Version updated to 2.0.0-alpha.42

### ⚙️ Configuration Updates
- .gitignore excludes SQLite database files
- .npmignore includes necessary memory components
- CLI version consistency at 2.0.0-alpha.42

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 05:01:13 +00:00

35 lines
838 B
TypeScript

/**
* Test setup for SPARC Memory Bank
*/
import { beforeAll, afterAll } from 'vitest';
import * as fs from 'fs/promises';
// Global test setup
beforeAll(async () => {
// Ensure test directories exist
await fs.mkdir('/tmp', { recursive: true }).catch(() => {});
});
// Global test cleanup
afterAll(async () => {
// Clean up any remaining test files
const testDirs = [
'/tmp/memory-test',
'/tmp/backend-test-sqlite',
'/tmp/backend-test-markdown',
'/tmp/indexer-test',
'/tmp/namespace-test',
'/tmp/replication-test'
];
for (const dir of testDirs) {
await fs.rm(dir, { recursive: true, force: true }).catch(() => {});
}
});
// Mock timers configuration
global.setTimeout = setTimeout;
global.clearTimeout = clearTimeout;
global.setInterval = setInterval;
global.clearInterval = clearInterval;