diff --git a/tests/unit/services/command.help.test.ts b/tests/unit/services/command.help.test.ts index 3d88476..531bfd8 100644 --- a/tests/unit/services/command.help.test.ts +++ b/tests/unit/services/command.help.test.ts @@ -1,7 +1,22 @@ -import { describe, it, expect } from 'bun:test'; +import { describe, it, expect, beforeAll, afterAll } from 'bun:test'; +import { Database } from 'bun:sqlite'; +import { initializeDatabase } from '../../../src/db'; +import { setDb, resetDb } from '../../../src/db/locator'; import { CommandService } from '../../../src/services/command'; describe('CommandService - /t ayuda y /t ayuda avanzada usando help centralizado', () => { + let memdb: Database; + + beforeAll(() => { + memdb = new Database(':memory:'); + initializeDatabase(memdb); + setDb(memdb); + }); + + afterAll(() => { + resetDb(); + try { (memdb as any)?.close?.(); } catch {} + }); it('"/t ayuda" incluye quick help y CTA a ayuda avanzada', async () => { const res = await CommandService.handle({ sender: '600000001',