Skip to content

Commit

Permalink
Core: Add memory to the error event to allow late event listeners
Browse files Browse the repository at this point in the history
Cherry-picked from 15acb36 (3.0.0-dev).
> HTML Reporter: Add support for displaying early errors
> Ref #1786.
  • Loading branch information
Krinkle committed Jan 26, 2025
1 parent 01f7780 commit 42050fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const SUPPORTED_EVENTS = [
'runEnd'
];
const MEMORY_EVENTS = [
'error',
'runEnd'
];

Expand Down Expand Up @@ -40,7 +41,7 @@ export function emit (eventName, data) {
callbacks[i](data);
}

if (inArray(MEMORY_EVENTS, eventName)) {
if (inArray(eventName, MEMORY_EVENTS)) {
config._event_memory[eventName] = data;
}
}
Expand Down

0 comments on commit 42050fc

Please sign in to comment.