Skip to content

Commit

Permalink
fix: simplify logGherkin configuration and pass when defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Shelex committed Sep 29, 2021
1 parent 6a5865c commit 51a7be1
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions reporter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 51a7be1

Please sign in to comment.