test(hygiene): close every brain the integration suite creates
Each file opened a Brainy in beforeAll/beforeEach (or a single it()) and never closed it. related-verb-array.test.ts and vfs-containment-batched.test.ts were real bugs: their afterAll discarded the brain with `brain = null as any` without ever calling close() first.
This commit is contained in:
parent
4c344782a7
commit
d6e7453f1f
7 changed files with 24 additions and 5 deletions
|
|
@ -9,9 +9,10 @@ import * as XLSX from 'xlsx'
|
|||
describe('VFS Debug', () => {
|
||||
it('minimal VFS writeFile test', async () => {
|
||||
const brain = new Brainy({ requireSubtype: false, storage: { type: 'memory' } })
|
||||
await brain.init()
|
||||
try {
|
||||
await brain.init()
|
||||
|
||||
console.log('✅ Brain initialized')
|
||||
console.log('✅ Brain initialized')
|
||||
|
||||
// Get VFS and initialize
|
||||
const vfs = brain.vfs
|
||||
|
|
@ -77,5 +78,8 @@ describe('VFS Debug', () => {
|
|||
// THE REAL TEST: Can we query VFS?
|
||||
expect(children.length).toBeGreaterThan(0)
|
||||
expect(rootContents.length).toBeGreaterThan(0)
|
||||
} finally {
|
||||
await brain.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Reference in a new issue