Skip to content

Commit

Permalink
fixes #4994 - Preserves error.name during serialization process so ty…
Browse files Browse the repository at this point in the history
…pe of error can be used by reporters who differentiate between failed tests and broken tests, such as allure-mocha
  • Loading branch information
jamesmortensen committed Jul 8, 2023
1 parent 37deed2 commit 1c59fac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/nodejs/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ class SerializableEvent {
value = Object.assign(Object.create(null), value, {
stack: value.stack,
message: value.message,
__type: 'Error'
__type: 'Error',
name: value.name
});
parent[key] = value;
// after this, set the result of type(value) to be `object`, and we'll throw
Expand Down

0 comments on commit 1c59fac

Please sign in to comment.