diff --git a/src/DocCoverage/DocCoverageUtils/propTypesCoverageReact.js b/src/DocCoverage/DocCoverageUtils/propTypesCoverageReact.js index 0756ff3..3b5b1c7 100644 --- a/src/DocCoverage/DocCoverageUtils/propTypesCoverageReact.js +++ b/src/DocCoverage/DocCoverageUtils/propTypesCoverageReact.js @@ -47,7 +47,7 @@ class PropTypesCoverageReact { ]; if (parentKey === astConstants.INIT) { if (grandParentValue.id.name) { - uniquePush(propsArr, grandParentValue.id.name); + // uniquePush(propsArr, grandParentValue.id.name); } else { grandParentValue.id.properties.forEach((p) => uniquePush(propsArr, p.key?.name || p.value?.name) diff --git a/src/DocCoverage/index.js b/src/DocCoverage/index.js index 30bcaeb..13fb929 100644 --- a/src/DocCoverage/index.js +++ b/src/DocCoverage/index.js @@ -104,21 +104,23 @@ class DocumentationCoverage { numOfPropTypesDefined += totalPropsLength - missingPropTypesLength; return { hasStory: false, + totalPropCount: totalPropsLength, hasAllPropTypes: totalPropsLength ? missingPropTypesLength === 0 - : false, + : true, + missingPropCount: missingPropTypesLength, componentType: isClassComponent ? 'Class Based' : 'Functional', missingPropTypes: totalPropsLength && totalPropsLength !== missingPropTypesLength ? missingPropTypes - : 'No PropTypes Found', + : [], coverage: `${ totalPropsLength ? getCoveragePercentage( totalPropsLength - missingPropTypesLength, totalPropsLength ) - : 0 + : 100 }%`, }; }