Initial project documentation and status

This commit is contained in:
Clawdia
2026-08-30 14:46:23 -04:00
commit 765f372c72
50 changed files with 12916 additions and 0 deletions
@@ -0,0 +1,39 @@
/**
* Tests for the adapter factory function.
*/
import { createMeshCentralAdapter } from '../adapter';
import { BridgeError } from '../contracts';
describe('createMeshCentralAdapter', () => {
it('should return mock adapter by default', () => {
const adapter = createMeshCentralAdapter();
expect(adapter.name).toBe('mock');
});
it('should return mock adapter when adapterType is mock', () => {
const adapter = createMeshCentralAdapter({ adapterType: 'mock' });
expect(adapter.name).toBe('mock');
});
it('should throw for real adapter without credentials', async () => {
// Real adapter requires credentials
expect(() =>
createMeshCentralAdapter({ adapterType: 'real', meshCentralUrl: 'http://test:8080' }),
).toThrow(BridgeError);
});
it('should accept custom configuration', () => {
const config = {
meshCentralUrl: 'http://custom-url:8080',
timeoutMs: 5_000,
maxOutputLength: 32_768,
};
const adapter = createMeshCentralAdapter(config);
expect(adapter.name).toBe('mock');
// Verify mock adapter receives config (would be used by real adapter)
expect(adapter).toBeDefined();
});
});