Skip to content

Commit

Permalink
Use implicit return in arrow function, clarifying similar pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed Jan 8, 2025
1 parent 52f6fc0 commit 555b162
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/cli/src/commands/testHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ export const handler = async ({
if (Array.isArray(flagValue)) {
// jest does not collapse flags e.g. --coverageReporters=html --coverageReporters=text
// so we pass it on. Yargs collapses these flags into an array of values
return flagValue.flatMap((val) => {
return [flagName.length > 1 ? `--${flagName}` : `-${flagName}`, val]
})
return flagValue.flatMap((val) => [
flagName.length > 1 ? `--${flagName}` : `-${flagName}`,
val,
])
} else {
return [
flagName.length > 1 ? `--${flagName}` : `-${flagName}`,
Expand Down

0 comments on commit 555b162

Please sign in to comment.