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

Getting error Unhandled asynchronous exception: Unhandled asynchronous exception instead of specific error #316

Open
nikh33 opened this issue Jun 3, 2024 · 0 comments

Comments

@nikh33
Copy link

nikh33 commented Jun 3, 2024

I have multiple test files. I want to run them in parallel programmatically. If one of the test files fail with Uncaught exception, testing stops. I checked the source code and saw that you are using process.exit after Uncaught exception I tried to set bail:false but it didn't change anything.

I want to run all test files in parallel and get specific error related to failure instead of Unhandled asynchronous exception: Unhandled asynchronous exception
I console reason in setProcessExitListeners function in mocha-parallel-test package dist/util.js file

function setProcessExitListeners() { process.on('unhandledRejection', reason => { const message = reason && 'stack' in reason ? reason.stack : 'Unhandled asynchronous exception'; // eslint-disable-next-line no-console console.error(Unhandled asynchronous exception: ${message}); process.exit(1); }); process.on('uncaughtException', err => { // eslint-disable-next-line no-console console.error(Uncaught exception: ${err.stack}); process.exit(1); }); }

getting
{ diagnosticText: "tests/integ/data/data.ts(9,41): error TS2551: Property 'atricle1' does not exist on type '{ atricle2: string; }'. Did you mean 'atricle2'?\n", diagnosticCodes: [ 2551 ] }

As reason.stack is undefined getting Unhandled asynchronous exception in error message

can you please help to get error message related to failure

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

No branches or pull requests

1 participant