Skip to content

[Feature]: Display Error's cause when test has failed #12999

@Nokel81

Description

@Nokel81

🚀 Feature Proposal

JS's Error class has recently been enhanced with native support for chaining instances together during construction using a second parameter and the { cause: parentErrorInstance } option.

It would be great if when a test fails because of a throw error the cause of the error would also be displayed.

Motivation

When wrapping errors the cause can give a lot of necessary information to help figure out why a test is failing

Example

N/A, this would just change the default formatter on test failure

Pitch

The changes to Error are part of the ECMAScript standard and are available in Node 16 so more people will start using them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions