chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase

This commit is contained in:
David Snelling 2026-06-11 14:51:00 -07:00
parent 970e08c466
commit 1f7e365a4e
237 changed files with 1951 additions and 49413 deletions

View file

@ -203,7 +203,7 @@ describe('Brainy v3.0 Core API Tests', () => {
type: NounType.Document
})
const success = await brain.delete(id)
const success = await brain.remove(id)
expect(success).toBe(true)
const item = await brain.get(id)
@ -211,7 +211,7 @@ describe('Brainy v3.0 Core API Tests', () => {
})
it('should return false for non-existent ID', async () => {
const success = await brain.delete('non-existent')
const success = await brain.remove('non-existent')
expect(success).toBe(false)
})
@ -222,7 +222,7 @@ describe('Brainy v3.0 Core API Tests', () => {
)
)
await Promise.all(ids.map(id => brain.delete(id)))
await Promise.all(ids.map(id => brain.remove(id)))
// delete returns void, not boolean
// Verify all deleted
@ -259,7 +259,7 @@ describe('Brainy v3.0 Core API Tests', () => {
type: VerbType.Creates
})
const relations = await brain.getRelations({ from: entityA })
const relations = await brain.related({ from: entityA })
expect(relations.length).toBeGreaterThanOrEqual(1)
expect(relations[0].from).toBe(entityA)
@ -275,7 +275,7 @@ describe('Brainy v3.0 Core API Tests', () => {
const success = await brain.unrelate(verbId)
expect(success).toBe(true)
const relations = await brain.getRelations({ from: entityA })
const relations = await brain.related({ from: entityA })
const found = relations.find(r => r.id === verbId)
expect(found).toBeUndefined()
})
@ -305,7 +305,7 @@ describe('Brainy v3.0 Core API Tests', () => {
)
// Then delete them in batch
const result = await brain.deleteMany({ ids })
const result = await brain.removeMany({ ids })
expect(result.successful).toHaveLength(5)
expect(result.failed).toHaveLength(0)