Skip to content

Commit

Permalink
Fix jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Sep 29, 2020
1 parent 3a588db commit 718cab3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x-pack/plugins/alerts/server/alerts_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,9 @@ describe('create()', () => {

test('throws error if loading actions fails', async () => {
const data = getMockData();
actionsClient.getBulk.mockRejectedValueOnce(new Error('Test Error'));
// Reset from default behaviour
actionsClient.getBulk.mockReset();
actionsClient.getBulk.mockRejectedValue(new Error('Test Error'));
await expect(alertsClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot(
`"Test Error"`
);
Expand Down

0 comments on commit 718cab3

Please sign in to comment.