This is the test I'm trying to run:
it('should return Notification Groups', (done) => {
fetchAppNotifications('123', 'abc').subscribe((response) => {
try {
expect(response).toEqual(MOCK_FETCH_APP_NOTIFICATIONS_RESPONSE);
done();
} catch (error) {
done.fail(error);
}
});
});
I get the following errors back:
- Timeout - Async callback was not invoked within the 5000 ms timeout specified
- Expected at least one assertion to be called but received none.
This is the function being tested:
export function fetchAppNotifications(practiceId: string, clinicId: string): Observable<INotificationGroups> {
const start = format(startOfDay(new Date()), 'M/d/yyyy');
const end = format(endOfDay(new Date()), 'M/d/yyyy');
return GET<INotificationGroups>(Api.Portal, 'AppNotifications/Get', {
params: {
practiceId,
start,
end,
type: '0',
status: '0',
clinicId,
},
});
}
I've tried googling these errors but I'm not getting any help from them. There are other tests, identical to this one for other functions that run fine without either of those errors. I'm at a complete loss as to what would be causing this here, but not on other tests. Using Jest 26.6.3