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

@ -174,7 +174,7 @@ describe('Error Handling and Recovery', () => {
it('should handle deletion of non-existent entities', async () => {
// Should not throw, just return void
await expect(
brainy.delete('non-existent-id')
brainy.remove('non-existent-id')
).resolves.toBeUndefined()
})
@ -184,9 +184,9 @@ describe('Error Handling and Recovery', () => {
type: 'document'
})
await brainy.delete(id)
await brainy.remove(id)
// Second delete should not throw
await expect(brainy.delete(id)).resolves.toBeUndefined()
await expect(brainy.remove(id)).resolves.toBeUndefined()
})
})
@ -364,7 +364,7 @@ describe('Error Handling and Recovery', () => {
})
// Attempt concurrent deletes
const deletes = Array(5).fill(null).map(() => brainy.delete(id))
const deletes = Array(5).fill(null).map(() => brainy.remove(id))
// Should not throw
await expect(Promise.all(deletes)).resolves.toBeDefined()
@ -428,7 +428,7 @@ describe('Error Handling and Recovery', () => {
)
break
case 3:
promises.push(brainy.delete(`rapid-${i}`).catch(() => null))
promises.push(brainy.remove(`rapid-${i}`).catch(() => null))
break
}
}
@ -578,7 +578,7 @@ describe('Error Handling and Recovery', () => {
type: 'document'
})
await brainy.delete(id)
await brainy.remove(id)
// Operations on deleted entity should handle gracefully
const getResult = await brainy.get(id)
@ -592,7 +592,7 @@ describe('Error Handling and Recovery', () => {
).rejects.toThrow(/not found/i)
// Should not throw for delete
await expect(brainy.delete(id)).resolves.toBeUndefined()
await expect(brainy.remove(id)).resolves.toBeUndefined()
})
it('should handle rapid create-delete cycles', async () => {
@ -605,7 +605,7 @@ describe('Error Handling and Recovery', () => {
})
// Immediately delete
await brainy.delete(id)
await brainy.remove(id)
// Verify it's gone
const result = await brainy.get(id)