fixed format issues
This commit is contained in:
parent
a700818a06
commit
08f713d98b
55 changed files with 5680 additions and 5533 deletions
|
|
@ -1,77 +1,77 @@
|
|||
import { describe, it, expect } from 'bun:test';
|
||||
import * as handlerRegistryExports from '../src';
|
||||
import { HandlerRegistry } from '../src';
|
||||
|
||||
describe('Handler Registry Package Exports', () => {
|
||||
it('should export HandlerRegistry class', () => {
|
||||
expect(handlerRegistryExports.HandlerRegistry).toBeDefined();
|
||||
expect(handlerRegistryExports.HandlerRegistry).toBe(HandlerRegistry);
|
||||
});
|
||||
|
||||
it('should export correct types', () => {
|
||||
// Type tests - compile-time checks
|
||||
type TestHandlerMetadata = handlerRegistryExports.HandlerMetadata;
|
||||
type TestOperationMetadata = handlerRegistryExports.OperationMetadata;
|
||||
type TestScheduleMetadata = handlerRegistryExports.ScheduleMetadata;
|
||||
type TestHandlerConfiguration = handlerRegistryExports.HandlerConfiguration;
|
||||
type TestRegistryStats = handlerRegistryExports.RegistryStats;
|
||||
type TestHandlerDiscoveryResult = handlerRegistryExports.HandlerDiscoveryResult;
|
||||
|
||||
// Runtime type usage tests
|
||||
const testHandler: TestHandlerMetadata = {
|
||||
name: 'TestHandler',
|
||||
serviceName: 'test-service',
|
||||
operations: [],
|
||||
};
|
||||
|
||||
const testOperation: TestOperationMetadata = {
|
||||
operationName: 'testOperation',
|
||||
handlerName: 'TestHandler',
|
||||
operationPath: 'test.operation',
|
||||
serviceName: 'test-service',
|
||||
};
|
||||
|
||||
const testSchedule: TestScheduleMetadata = {
|
||||
handlerName: 'TestHandler',
|
||||
scheduleName: 'test-schedule',
|
||||
expression: '*/5 * * * *',
|
||||
serviceName: 'test-service',
|
||||
};
|
||||
|
||||
const testConfig: TestHandlerConfiguration = {
|
||||
handlerName: 'TestHandler',
|
||||
batchSize: 10,
|
||||
timeout: 5000,
|
||||
retries: 3,
|
||||
};
|
||||
|
||||
const testStats: TestRegistryStats = {
|
||||
totalHandlers: 5,
|
||||
totalOperations: 10,
|
||||
totalSchedules: 3,
|
||||
handlersByService: {
|
||||
'service1': 2,
|
||||
'service2': 3,
|
||||
},
|
||||
};
|
||||
|
||||
const testDiscoveryResult: TestHandlerDiscoveryResult = {
|
||||
handlers: [testHandler],
|
||||
operations: [testOperation],
|
||||
schedules: [testSchedule],
|
||||
configurations: [testConfig],
|
||||
};
|
||||
|
||||
expect(testHandler).toBeDefined();
|
||||
expect(testOperation).toBeDefined();
|
||||
expect(testSchedule).toBeDefined();
|
||||
expect(testConfig).toBeDefined();
|
||||
expect(testStats).toBeDefined();
|
||||
expect(testDiscoveryResult).toBeDefined();
|
||||
});
|
||||
|
||||
it('should create HandlerRegistry instance', () => {
|
||||
const registry = new HandlerRegistry();
|
||||
expect(registry).toBeInstanceOf(HandlerRegistry);
|
||||
});
|
||||
});
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import * as handlerRegistryExports from '../src';
|
||||
import { HandlerRegistry } from '../src';
|
||||
|
||||
describe('Handler Registry Package Exports', () => {
|
||||
it('should export HandlerRegistry class', () => {
|
||||
expect(handlerRegistryExports.HandlerRegistry).toBeDefined();
|
||||
expect(handlerRegistryExports.HandlerRegistry).toBe(HandlerRegistry);
|
||||
});
|
||||
|
||||
it('should export correct types', () => {
|
||||
// Type tests - compile-time checks
|
||||
type TestHandlerMetadata = handlerRegistryExports.HandlerMetadata;
|
||||
type TestOperationMetadata = handlerRegistryExports.OperationMetadata;
|
||||
type TestScheduleMetadata = handlerRegistryExports.ScheduleMetadata;
|
||||
type TestHandlerConfiguration = handlerRegistryExports.HandlerConfiguration;
|
||||
type TestRegistryStats = handlerRegistryExports.RegistryStats;
|
||||
type TestHandlerDiscoveryResult = handlerRegistryExports.HandlerDiscoveryResult;
|
||||
|
||||
// Runtime type usage tests
|
||||
const testHandler: TestHandlerMetadata = {
|
||||
name: 'TestHandler',
|
||||
serviceName: 'test-service',
|
||||
operations: [],
|
||||
};
|
||||
|
||||
const testOperation: TestOperationMetadata = {
|
||||
operationName: 'testOperation',
|
||||
handlerName: 'TestHandler',
|
||||
operationPath: 'test.operation',
|
||||
serviceName: 'test-service',
|
||||
};
|
||||
|
||||
const testSchedule: TestScheduleMetadata = {
|
||||
handlerName: 'TestHandler',
|
||||
scheduleName: 'test-schedule',
|
||||
expression: '*/5 * * * *',
|
||||
serviceName: 'test-service',
|
||||
};
|
||||
|
||||
const testConfig: TestHandlerConfiguration = {
|
||||
handlerName: 'TestHandler',
|
||||
batchSize: 10,
|
||||
timeout: 5000,
|
||||
retries: 3,
|
||||
};
|
||||
|
||||
const testStats: TestRegistryStats = {
|
||||
totalHandlers: 5,
|
||||
totalOperations: 10,
|
||||
totalSchedules: 3,
|
||||
handlersByService: {
|
||||
service1: 2,
|
||||
service2: 3,
|
||||
},
|
||||
};
|
||||
|
||||
const testDiscoveryResult: TestHandlerDiscoveryResult = {
|
||||
handlers: [testHandler],
|
||||
operations: [testOperation],
|
||||
schedules: [testSchedule],
|
||||
configurations: [testConfig],
|
||||
};
|
||||
|
||||
expect(testHandler).toBeDefined();
|
||||
expect(testOperation).toBeDefined();
|
||||
expect(testSchedule).toBeDefined();
|
||||
expect(testConfig).toBeDefined();
|
||||
expect(testStats).toBeDefined();
|
||||
expect(testDiscoveryResult).toBeDefined();
|
||||
});
|
||||
|
||||
it('should create HandlerRegistry instance', () => {
|
||||
const registry = new HandlerRegistry();
|
||||
expect(registry).toBeInstanceOf(HandlerRegistry);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue