Skip to content

Commit 1c59fac

Browse files
fixes mochajs#4994 - Preserves error.name during serialization process so type of error can be used by reporters who differentiate between failed tests and broken tests, such as allure-mocha
1 parent 37deed2 commit 1c59fac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/nodejs/serializer.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ class SerializableEvent {
204204
value = Object.assign(Object.create(null), value, {
205205
stack: value.stack,
206206
message: value.message,
207-
__type: 'Error'
207+
__type: 'Error',
208+
name: value.name
208209
});
209210
parent[key] = value;
210211
// after this, set the result of type(value) to be `object`, and we'll throw

0 commit comments

Comments
 (0)