import { handleAlksDeveloperLogin } from './alks-developer-login'; import { errorAndExit } from '../errorAndExit'; jest.mock('../errorAndExit'); describe('handleAlksDeveloperLogin', () => { afterEach(() => { jest.resetAllMocks(); }); it('errors directing the user to login2fa (basic auth removed)', async () => { await handleAlksDeveloperLogin({}); expect(errorAndExit).toHaveBeenCalledTimes(1); const message = (errorAndExit as unknown as jest.Mock).mock .calls[0][0] as string; expect(message).toContain('Basic authentication has been removed'); expect(message).toContain('login2fa'); }); });