From 51a7be14703b14f4b07b5cf96436f92f19148552 Mon Sep 17 00:00:00 2001 From: Shelex Date: Wed, 29 Sep 2021 12:59:37 +0300 Subject: [PATCH] fix: simplify logGherkin configuration and pass when defined --- reporter/index.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/reporter/index.js b/reporter/index.js index 244f31a..fe4e28a 100644 --- a/reporter/index.js +++ b/reporter/index.js @@ -31,18 +31,12 @@ const shouldEnableGherkinLogging = () => { const isLogCypressDefined = typeof logCypress !== 'undefined'; const isLogGherkinDefined = typeof logGherkin !== 'undefined'; - // enable by default - if (!isLogCypressDefined && !isLogGherkinDefined) { - return true; - } - - // inherit logCypress in case directly set - if (isLogCypressDefined && !isLogGherkinDefined) { - return logCypress; - } - - // use env var - return logGherkin !== false; + return isLogGherkinDefined + ? logGherkin + : // in case logGherkin is not defined use logCypress value or true by default + isLogCypressDefined + ? logCypress + : true; }; const config = {