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