godcrm/backend/database/adapters/__tests__/DatabaseAdapter.test.js
GOD CRM Release f89e074dd1
Some checks failed
CI / Lint / Typecheck / Test / Build (push) Has been cancelled
CI / PostgreSQL Integration Tests (push) Has been cancelled
GOD CRM — public scrubbed snapshot
Governed substrate for autonomous agents: scoped identity (passports),
audited actions, MCP workspace. Infra IPs and secrets redacted for public release.
2026-08-10 04:01:45 +03:00

46 lines
1.7 KiB
JavaScript

// backend/database/adapters/__tests__/DatabaseAdapter.test.js
// TDD: RED phase - Tests for abstract DatabaseAdapter interface
import { describe, it, expect } from 'vitest';
import { DatabaseAdapter } from '../DatabaseAdapter.js';
describe('DatabaseAdapter Interface', () => {
it('should throw Not implemented for query()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.query('SELECT 1')).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for get()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.get('SELECT 1')).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for all()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.all('SELECT 1')).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for run()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.run('SELECT 1')).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for transaction()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.transaction(() => {})).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for ping()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.ping()).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for close()', async () => {
const adapter = new DatabaseAdapter();
await expect(adapter.close()).rejects.toThrow('Not implemented');
});
it('should throw Not implemented for getKnex()', () => {
const adapter = new DatabaseAdapter();
expect(() => adapter.getKnex()).toThrow('Not implemented');
});
});