I have created this class:
export class ErrorList {
public HostelNotFoundError(details: ErrorDetail): FunctionalError {
return new FunctionalError('1', 'Can\'t find this hostel', details);
}
and in the service:
throw new ErrorList().HostelNotFoundError({} });
I would like to know if in Jest is possible to do something like:
rejects.toThrow(HostelNotFoundError);