feat: add BoxBrain persona runtime APIs
This commit is contained in:
16
tests/helpers.ts
Normal file
16
tests/helpers.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { IdentityDB } from 'identitydb';
|
||||
|
||||
const openDbs: IdentityDB[] = [];
|
||||
|
||||
export async function createDb() {
|
||||
const db = await IdentityDB.connect({ client: 'sqlite', filename: ':memory:' });
|
||||
await db.initialize();
|
||||
openDbs.push(db);
|
||||
return db;
|
||||
}
|
||||
|
||||
export async function closeOpenDbs() {
|
||||
while (openDbs.length > 0) {
|
||||
await openDbs.pop()!.close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user