- Fixed imports in examples/tests/ to use correct Brainy import - Fixed imports in tests/benchmarks/ to use correct paths - Updated bin/brainy-interactive.js to use Brainy instead of BrainyData - Corrected documentation references throughout codebase - Removed duplicate imports in benchmark files - All files now consistently use 'Brainy' class from dist/index.js
41 lines
No EOL
1 KiB
JavaScript
41 lines
No EOL
1 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
// Minimal test to verify core works without memory issues
|
|
import { Brainy } from './dist/index.js'
|
|
|
|
console.log('🧪 Minimal Brainy Test')
|
|
|
|
async function minimalTest() {
|
|
try {
|
|
// Just test initialization and basic add
|
|
const brain = new Brainy({
|
|
storage: { forceMemoryStorage: true },
|
|
verbose: false,
|
|
// Disable features that might use memory
|
|
enableAugmentations: false,
|
|
cache: { enabled: false }
|
|
})
|
|
|
|
console.log('1. Initializing...')
|
|
await brain.init()
|
|
|
|
console.log('2. Adding noun...')
|
|
const id = await brain.addNoun({
|
|
name: 'Test',
|
|
value: 123
|
|
})
|
|
|
|
console.log('3. Getting noun...')
|
|
const noun = await brain.getNoun(id)
|
|
|
|
console.log(`✅ Success! Retrieved: ${noun.name}`)
|
|
console.log(`Memory: ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`)
|
|
|
|
process.exit(0)
|
|
} catch (error) {
|
|
console.error('❌ Failed:', error.message)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
minimalTest() |