From 280dd7c6427ff4e7109b3b0ae4838de24b975036 Mon Sep 17 00:00:00 2001 From: Juan Fernandez Date: Thu, 26 Sep 2024 13:49:45 +0200 Subject: [PATCH] add guard --- packages/datadog-instrumentations/src/mocha/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datadog-instrumentations/src/mocha/main.js b/packages/datadog-instrumentations/src/mocha/main.js index c5258a27bc0..2e796a71371 100644 --- a/packages/datadog-instrumentations/src/mocha/main.js +++ b/packages/datadog-instrumentations/src/mocha/main.js @@ -277,7 +277,7 @@ addHook({ const testSuites = this.files.map(file => getTestSuitePath(file, process.cwd())) const isFaulty = getIsFaultyEarlyFlakeDetection( testSuites, - config.knownTests.mocha, + config.knownTests?.mocha || {}, config.earlyFlakeDetectionFaultyThreshold ) if (isFaulty) { @@ -541,7 +541,7 @@ addHook({ const testSuites = files.map(file => getTestSuitePath(file, process.cwd())) const isFaulty = getIsFaultyEarlyFlakeDetection( testSuites, - config.knownTests.mocha, + config.knownTests?.mocha || {}, config.earlyFlakeDetectionFaultyThreshold ) if (isFaulty) {