diff --git a/packages/create-jest/src/generateConfigFile.ts b/packages/create-jest/src/generateConfigFile.ts index b52cc77a55ee..5f774b163091 100644 --- a/packages/create-jest/src/generateConfigFile.ts +++ b/packages/create-jest/src/generateConfigFile.ts @@ -14,9 +14,9 @@ const stringifyOption = ( map: Partial, linePrefix = '', ): string => { - const optionDescription = descriptions[option] - ? ` // ${descriptions[option]}` - : ''; + const description = descriptions[option]; + const optionDescription = + description != null && description.length > 0 ? ` // ${description}` : ''; const stringifiedObject = `${option}: ${JSON.stringify( map[option], null,