Skip to content

fix(workers): deserialize step events before emitting to master process#5565

Open
gololdf1sh wants to merge 1 commit into
codeceptjs:4.xfrom
gololdf1sh:fix/deserialize-step-events-in-workers
Open

fix(workers): deserialize step events before emitting to master process#5565
gololdf1sh wants to merge 1 commit into
codeceptjs:4.xfrom
gololdf1sh:fix/deserialize-step-events-in-workers

Conversation

@gololdf1sh
Copy link
Copy Markdown

@gololdf1sh gololdf1sh commented May 15, 2026

Problem

In run-workers mode, step events (step.started, step.finished, step.passed, step.failed) are emitted as raw plain objects from IPC serialization. These objects lack Step class methods (toString(), toCliStyled()), so any plugin or reporter calling step.toString() gets "[object Object]" instead of the actual step description.

This affects all consumers of step events in worker mode — for example, @testomatio/reporter shows:

################[ Logs ]################
--- Test ---
[object Object]
 [object Object]

Test events already go through deserializeTest() which restores a full object with methods. Step events had no equivalent deserialization — this PR adds it.

Solution

Add deserializeStep() — a one-liner that wraps the serialized data in a Step instance via Object.assign(new Step(data.title), data), matching the pattern already used inside deserializeTest for test.steps (see lib/mocha/test.js:80).

Apply it to all four step event types before emitting.

Related

  • testomatio/e2e-tests#151 — original report with reproduction steps

Step events (started, finished, passed, failed) were emitted as raw
plain objects from IPC serialization. Plugins listening to these events
received objects without Step class methods (toString, toCliStyled),
causing [object Object] in reporter output.

Apply the same deserialization pattern already used for test events
(deserializeTest) — wrap message.data in a Step instance via
Object.assign(new Step(data.title), data).

Ref: testomatio/e2e-tests#151

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant