Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
chore: abort with error message (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianok committed Jul 4, 2023
1 parent 991ea3b commit d1c6420
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/one-app-runner/__tests__/utils/waitForOK.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ describe('waitForOk', () => {

const abortController = new AbortController();
const waitingPromise = waitForOK({ url: 'http://mockurl.com', timeout: 3000, signal: abortController.signal });

jest.advanceTimersByTime(2000);
abortController.abort();
await expect(waitingPromise).rejects.toMatchInlineSnapshot('[Error: AbortError: This operation was aborted]');

abortController.abort('This operation was aborted');

await expect(waitingPromise).rejects.toMatchInlineSnapshot('[Error: This operation was aborted]');
});
});

0 comments on commit d1c6420

Please sign in to comment.