From 6cc0638d24c8528c783b6b41ec966aeb71b94aab Mon Sep 17 00:00:00 2001 From: David Goss Date: Mon, 14 Nov 2022 19:38:38 +0000 Subject: [PATCH] fix doco example --- docs/parallel.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/parallel.md b/docs/parallel.md index 864883978..e8135e9b0 100644 --- a/docs/parallel.md +++ b/docs/parallel.md @@ -81,13 +81,15 @@ const { Formatter } = require('@cucumber/cucumber') class ExampleFormatter extends Formatter { constructor(options) { - options.eventBroadcaster.on('testCaseStarted', (envelope) => { - if (envelope.workerId) { - console.log( - `the event has been fired from a worker with id ${envelope.workerId}` - ) - } else { - console.log('the event has been sent from the main thread') + options.eventBroadcaster.on('envelope', (envelope) => { + if (envelope.testCaseStarted) { + if (envelope.testCaseStarted.workerId) { + console.log( + `the event has been fired from a worker with id ${envelope.testCaseStarted.workerId}` + ) + } else { + console.log('the event has been sent from the main thread') + } } })