Writing Unit Tests with Jest
What testing pattern is shown for Promise-based operations?
test('async operation completes', async () => {
  await expect(fetchData()).resolves.toEqual({ data: 'value' });
  await expect(failingFetch()).rejects.toThrow('Error');
});