Skip to content

Commit

Permalink
feat: pass worker id to hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw committed Sep 14, 2022
1 parent be2a53e commit 545f5be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var Runnable = require('./runnable');
const {inherits, constants} = require('./utils');
const {MOCHA_ID_PROP_NAME} = constants;
const {MOCHA_ID_PROP_NAME, MOCHA_WORKER_ID_PROP_NAME} = constants;

/**
* Expose `Hook`.
Expand Down Expand Up @@ -84,6 +84,7 @@ Hook.prototype.serialize = function serialize() {
state: this.state,
title: this.title,
type: this.type,
[MOCHA_ID_PROP_NAME]: this.id
[MOCHA_ID_PROP_NAME]: this.id,
[MOCHA_WORKER_ID_PROP_NAME]: process.env.MOCHA_WORKER_ID
};
};

0 comments on commit 545f5be

Please sign in to comment.