Jest mengharapkan fungsi async untuk melempar kesalahan
it('should test async errors', async () => {
await expect(failingAsyncTest())
.rejects
.toThrow('I should fail');
});
Worried Walrus