Fixed @tryghost/domain-events relying on NODE_ENV

When using this package without setting a NODE_ENV environment variable it would
completely crash.
This commit is contained in:
Fabien "egg" O'Carroll 2023-09-01 11:45:56 +07:00 committed by Fabien 'egg' O'Carroll
parent 355a033250
commit af9be12a08

View File

@ -69,7 +69,7 @@ class DomainEvents {
static #awaitQueue = [];
static #dispatchCount = 0;
static #processedCount = 0;
static #trackingEnabled = process.env.NODE_ENV.startsWith('test');
static #trackingEnabled = process.env.NODE_ENV?.startsWith('test');
/**
* Waits for all the events in the queue to be dispatched and fully processed (async).