cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.04k stars 1.09k forks source link

include stackTrace in result exception object #2371

Closed davidjgoss closed 8 months ago

davidjgoss commented 8 months ago

🤔 What's changed?

Cucumber Messages now includes a stackTrace prop on the exception object in a test step result. This PR includes that field, which consist of just the captured and filtered stack trace, without the error message.

Also, previously we only tried to parse the stack trace if we needed to filter it - now we always try, because we ideally want to strip the message off the front to populate this new stack trace prop.

⚡️ What's your motivation?

Generally, this is more useful for formatter authors, allowing them to build up a richer representation of an error from messages.

Specifically, we have #2348 where we want this field for the JUnit formatter.

🏷️ What kind of change is this?

📋 Checklist:


This text was originally generated from a template, then edited by hand. You can modify the template here.

coveralls commented 8 months ago

Coverage Status

coverage: 98.383%. remained the same when pulling c542af5c27ee69d0451d966ce1d9c45f03fb0021 on feat/exception-stack-trace into 567a49122cc45a5021f655f0f71602a3b870cbc2 on main.