Clear final M0 bugs on master (T-5 verified, T-12, T-15, T-17)

This commit is contained in:
Boki 2026-11-27 16:42:43 -05:00
parent ade0a3ef1d
commit 2ea7316af6
7 changed files with 148 additions and 17 deletions

View file

@ -267,6 +267,26 @@ describe('Handler Decorators', () => {
expect(constructor.__schedules[1]).toMatchObject({ cronPattern: '0 0 * * *' });
expect(constructor.__schedules[2]).toMatchObject({ cronPattern: '0 0 * * 0' });
});
it('should not register duplicate operation metadata when @Operation and @ScheduledOperation are both applied (T-17)', () => {
class DeduplicatedHandler {
@Operation('sync-all-exchanges')
@ScheduledOperation('sync-all-exchanges', '0 0 * * 0', {
priority: 10,
batch: { enabled: true, size: 25 },
})
async syncAllExchanges() {}
}
const constructor = DeduplicatedHandler as any;
expect(constructor.__operations).toHaveLength(1);
expect(constructor.__operations[0]).toEqual({
name: 'sync-all-exchanges',
method: 'syncAllExchanges',
batch: { enabled: true, size: 25 },
});
expect(constructor.__schedules).toHaveLength(1);
});
});
describe('decorator composition', () => {