Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle unhandled exceptions and rejections inside tests #825

Open
vigneshshanmugam opened this issue Aug 31, 2023 · 0 comments
Open

handle unhandled exceptions and rejections inside tests #825

vigneshshanmugam opened this issue Aug 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@vigneshshanmugam
Copy link
Member

vigneshshanmugam commented Aug 31, 2023

  • capture unhandled rejections and exceptions during the tests.
journey('reject', () => {
   Promise.reject("boom");
});

// Current behaviour

Journey: testing timeout issue - regular
/Users/vigneshh/elastic/synthetics/synth-init/journeys/debug-timeout.journey.ts:6
    Promise.reject(new Error("test error"));
                   ^

Error: test error
    at /Users/vigneshh/elastic/synthetics/synth-init/journeys/debug-timeout.journey.ts:31:20

Node.js v18.16.0
  • What we want
Journey: reject

Error: test error

   28 |  journey('reject', () => {
> 29 |  Promise.reject(new Error("test error"));
     |                     ^
  30 | });
  31 |

    at /Users/vigneshh/elastic/synthetics/synth-init/journeys/debug-timeout.journey.ts:31:20
1 failed (1319 ms)

TBD after #824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant