Skip to content

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

@nikh33

Description

@nikh33

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions