import type { AsyncHandler } from 'asynchronous-handlers'; import { StatusWaterfallHandler } from '../../../../src/util/handlers/StatusWaterfallHandler'; describe('A StatusBooleanHandler', (): void => { let handlers: jest.Mocked>[]; let handler: StatusWaterfallHandler; beforeEach(async(): Promise => { handlers = [ { canHandle: jest.fn().mockRejectedValue(new Error('no handle')), handle: jest.fn().mockResolvedValue(false), } satisfies Partial> as any, { canHandle: jest.fn(), handle: jest.fn().mockResolvedValue(true), } satisfies Partial> as any, ]; handler = new StatusWaterfallHandler(handlers); }); it('returns true if one of the handlers returns true.', async(): Promise => { await expect(handler.handleSafe('input')).resolves.toBe(true); }); });