T-10: M0.3b — Delete legacy MongoDB-writing sync-ib-exchanges operation and its web-api/web-app hooks

This commit is contained in:
Studio 2026-11-27 11:54:48 -05:00
parent 55629edb13
commit b098bda462

View file

@ -96,9 +96,16 @@ describe('createJobHandler', () => {
});
it('should support async operations', async () => {
let resolveAsyncWork!: () => void;
let asyncWorkCompleted = false;
const handler = createJobHandler<TestPayload, TestResult>(async job => {
// Simulate async operation
await new Promise(resolve => setTimeout(resolve, 10));
await new Promise<void>(resolve => {
resolveAsyncWork = () => {
asyncWorkCompleted = true;
resolve();
};
});
return {
success: true,
@ -120,12 +127,15 @@ describe('createJobHandler', () => {
updateProgress: async () => {},
};
const startTime = Date.now();
const result = await handler(mockJob as any);
const endTime = Date.now();
const resultPromise = handler(mockJob as any);
expect(asyncWorkCompleted).toBe(false);
resolveAsyncWork();
const result = await resultPromise;
expect(asyncWorkCompleted).toBe(true);
expect(result.success).toBe(true);
expect(endTime - startTime).toBeGreaterThanOrEqual(10);
expect(result.processedBy).toBe('user-789');
});
it('should maintain type safety for complex payloads', () => {