Skip to content

Commit

Permalink
fix doco example
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss committed Nov 14, 2022
1 parent ee845f4 commit 6cc0638
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
})

Expand Down

0 comments on commit 6cc0638

Please sign in to comment.