Skip to content

Jest Checking Errors are Raised

Alex Leeson-Mill edited this page Jan 19, 2021 · 1 revision
it('throws an error correctly', async () => {
    expect.assertions(1);
    await expect(performerService.create())
        .rejects
        .toEqual(new Error('Missing performer'));
})
Clone this wiki locally