Repository: anuraghazra/github-readme-stats
Pull request #3003 (2023-07-28 18:59:37)

Feature: Stats card: Show merged PRs count and percentage
This pull request adds ability to show count and percentage of merged PRs on stats card using `&show=` query option.

![image](https://github.com/anuraghazra/github-readme-stats/assets/53787217/06c991b7-a8df-4bff-afb7-77eace7e8683)

I'm not sure about merged PRs percentage icon, what do you think @rickstaa?
 

vercel[bot]: [vc]: #hyJtDcKCNdI74x4ytw6waXUJYt+ZRwOESvQiEP7L4fA=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJnaXRodWItcmVhZG1lLXN0YXRzIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL2dpdGh1Yi1yZWFkbWUtc3RhdHMtdGVhbS9naXRodWItcmVhZG1lLXN0YXRzL0d3WDkzYVJiTjJkVWNUSEVEaGNrdzhvOTN3dFEiLCJwcmV2aWV3VXJsIjoiZ2l0aHViLXJlYWRtZS1zdGF0cy1naXQtc2hvd21lci1jYTllMTktZ2l0aHViLXJlYWRtZS1zdGF0cy10ZWFtLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQifV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated (UTC) |
| :--- | :----- | :------ | :------ |
| **github-readme-stats** | ✅ Ready ([Inspect](https://vercel.com/github-readme-stats-team/github-readme-stats/GwX93aRbN2dUcTHEDhckw8o93wtQ)) | [Visit Preview](https://github-readme-stats-git-showmer-ca9e19-github-readme-stats-team.vercel.app) | Jul 28, 2023 6:59pm |


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) Report
Patch coverage: **`100.00%`** and project coverage change: **`+0.04%`** :tada:
> Comparison is base [(`6822dc7`)](https://app.codecov.io/gh/anuraghazra/github-readme-stats/commit/6822dc77d4af4b0412a6b991918d13d2e5cc3fc4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) 97.63% compared to head [(`ab5a97c`)](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) 97.67%.
> Report is 2 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3003      +/-   ##
==========================================
+ Coverage   97.63%   97.67%   +0.04%     
==========================================
  Files          24       24              
  Lines        5192     5294     +102     
  Branches      464      467       +3     
==========================================
+ Hits         5069     5171     +102     
  Misses        122      122              
  Partials        1        1              
```


| [Files Changed](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) | Coverage Δ | |
|---|---|---|
| [src/cards/stats-card.js](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra#diff-c3JjL2NhcmRzL3N0YXRzLWNhcmQuanM=) | `98.35% <100.00%> (+0.11%)` | :arrow_up: |
| [src/common/icons.js](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra#diff-c3JjL2NvbW1vbi9pY29ucy5qcw==) | `100.00% <100.00%> (ø)` | |
| [src/fetchers/stats-fetcher.js](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra#diff-c3JjL2ZldGNoZXJzL3N0YXRzLWZldGNoZXIuanM=) | `93.23% <100.00%> (+0.19%)` | :arrow_up: |
| [src/translations.js](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra#diff-c3JjL3RyYW5zbGF0aW9ucy5qcw==) | `99.86% <100.00%> (+0.01%)` | :arrow_up: |

... and [1 file with indirect coverage changes](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra)


</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/3003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra).


Patch:
diff --git a/readme.md b/readme.md
index 2760b19..d993558 100644
--- a/readme.md
+++ b/readme.md
@@ -156,10 +156,10 @@ You can pass a query parameter `&hide=` to hide any specific stats with comma-se
 
 You can pass a query parameter `&show=` to show any specific additional stats with comma-separated values.
 
-> Options: `&show=reviews,discussions_started,discussions_answered`
+> Options: `&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage`
 
 ```md
-![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show=reviews)
+![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage)
 ```
 
 ### Showing icons
@@ -548,7 +548,7 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
 
 *   Showing additional stats
 
-![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra\&show=reviews,discussions_started,discussions_answered)
+![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra\&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage)
 
 *   Showing icons
 
diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js
index 7c5d437..778e676 100644
--- a/src/cards/stats-card.js
+++ b/src/cards/stats-card.js
@@ -28,6 +28,7 @@ const RANK_ONLY_CARD_DEFAULT_WIDTH = 290;
  * @param {string} createTextNodeParams.label The label to display.
  * @param {number} createTextNodeParams.value The value to display.
  * @param {string} createTextNodeParams.id The id of the stat.
+ * @param {string=} createTextNodeParams.unitSymbol The unit symbol of the stat.
  * @param {number} createTextNodeParams.index The index of the stat.
  * @param {boolean} createTextNodeParams.showIcons Whether to show icons.
  * @param {number} createTextNodeParams.shiftValuePos Number of pixels the value has to be shifted to the right.
@@ -40,6 +41,7 @@ const createTextNode = ({
   label,
   value,
   id,
+  unitSymbol,
   index,
   showIcons,
   shiftValuePos,
@@ -69,7 +71,7 @@ const createTextNode = ({
         x="${(showIcons ? 140 : 120) + shiftValuePos}"
         y="12.5"
         data-testid="${id}"
-      >${kValue}</text>
+      >${kValue}${unitSymbol ? ` ${unitSymbol}` : ""}</text>
     </g>
   `;
 };
@@ -93,6 +95,8 @@ const renderStatsCard = (stats, options = {}) => {
     totalCommits,
     totalIssues,
     totalPRs,
+    totalPRsMerged,
+    mergedPRsPercentage,
     totalReviews,
     totalDiscussionsStarted,
     totalDiscussionsAnswered,
@@ -171,6 +175,25 @@ const renderStatsCard = (stats, options = {}) => {
     id: "prs",
   };
 
+  if (show.includes("prs_merged")) {
+    STATS.prs_merged = {
+      icon: icons.prs_merged,
+      label: i18n.t("statcard.prs-merged"),
+      value: totalPRsMerged,
+      id: "prs_merged",
+    };
+  }
+
+  if (show.includes("prs_merged_percentage")) {
+    STATS.prs_merged_percentage = {
+      icon: icons.prs_merged_percentage,
+      label: i18n.t("statcard.prs-merged-percentage"),
+      value: mergedPRsPercentage.toFixed(2),
+      id: "prs_merged_percentage",
+      unitSymbol: "%",
+    };
+  }
+
   if (show.includes("reviews")) {
     STATS.reviews = {
       icon: icons.reviews,
@@ -235,7 +258,11 @@ const renderStatsCard = (stats, options = {}) => {
     .map((key, index) =>
       // create the text nodes, and pass index so that we can calculate the line spacing
       createTextNode({
-        ...STATS[key],
+        icon: STATS[key].icon,
+        label: STATS[key].label,
+        value: STATS[key].value,
+        id: STATS[key].id,
+        unitSymbol: STATS[key].unitSymbol,
         index,
         showIcons: show_icons,
         shiftValuePos: 79.01 + (isLongLocale ? 50 : 0),
diff --git a/src/common/icons.js b/src/common/icons.js
index 3f91d86..d600c14 100644
--- a/src/common/icons.js
+++ b/src/common/icons.js
@@ -2,6 +2,8 @@ const icons = {
   star: `<path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"/>`,
   commits: `<path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"/>`,
   prs: `<path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"/>`,
+  prs_merged: `<path fill-rule="evenodd" d="M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z" />`,
+  prs_merged_percentage: `<path fill-rule="evenodd" d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0zM4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z" />`,
   issues: `<path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z"/>`,
   icon: `<path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"/>`,
   contribs: `<path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"/>`,
diff --git a/src/fetchers/stats-fetcher.js b/src/fetchers/stats-fetcher.js
index a1e2821..6cffdfd 100644
--- a/src/fetchers/stats-fetcher.js
+++ b/src/fetchers/stats-fetcher.js
@@ -54,6 +54,9 @@ const GRAPHQL_STATS_QUERY = `
       pullRequests(first: 1) {
         totalCount
       }
+      mergedPullRequests: pullRequests(states: MERGED) {
+        totalCount
+      }
       openIssues: issues(states: OPEN) {
         totalCount
       }
@@ -201,6 +204,8 @@ const fetchStats = async (
   const stats = {
     name: "",
     totalPRs: 0,
+    totalPRsMerged: 0,
+    mergedPRsPercentage: 0,
     totalReviews: 0,
     totalCommits: 0,
     totalIssues: 0,
@@ -246,6 +251,9 @@ const fetchStats = async (
   }
 
   stats.totalPRs = user.pullRequests.totalCount;
+  stats.totalPRsMerged = user.mergedPullRequests.totalCount;
+  stats.mergedPRsPercentage =
+    (user.mergedPullRequests.totalCount / user.pullRequests.totalCount) * 100;
   stats.totalReviews =
     user.contributionsCollection.totalPullRequestReviewContributions;
   stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
diff --git a/src/fetchers/types.d.ts b/src/fetchers/types.d.ts
index 3a86205..b0cc2f4 100644
--- a/src/fetchers/types.d.ts
+++ b/src/fetchers/types.d.ts
@@ -18,6 +18,8 @@ export type RepositoryData = {
 export type StatsData = {
   name: string;
   totalPRs: number;
+  totalPRsMerged: number;
+  mergedPRsPercentage: number;
   totalReviews: number;
   totalCommits: number;
   totalIssues: number;
diff --git a/src/translations.js b/src/translations.js
index b39f17b..1ced5f6 100644
--- a/src/translations.js
+++ b/src/translations.js
@@ -325,6 +325,66 @@ const statCardLocales = ({ name, apostrophe }) => {
       vi: "Tổng Số Thảo Luận Đã Trả Lời",
       se: "Totalt antal diskussioner besvarade",
     },
+    "statcard.prs-merged": {
+      ar: "مجموع الطلبات المدمجة",
+      cn: "合并的 PR 总数",
+      "zh-tw": "合併的 PR 總數",
+      cs: "Celkem sloučených PR",
+      de: "Insgesamt zusammengeführte PRs",
+      en: "Total PRs Merged",
+      bn: "সর্বমোট PR একত্রীকৃত",
+      es: "PR totales fusionados",
+      fr: "Nombre total de PR fusionnés",
+      hu: "Összes egyesített PR",
+      it: "PR totali uniti",
+      ja: "マージされた PR の総数",
+      kr: "병합된 총 PR",
+      nl: "Totaal samengevoegde PR's",
+      "pt-pt": "Total de PRs Fundidos",
+      "pt-br": "Total de PRs Fundidos",
+      np: "कुल PRs मर्ज गरिएको",
+      el: "Σύνολο Συγχωνευμένων PR",
+      ru: "Всего объединённых pull request`ов",
+      "uk-ua": "Всього об'єднаних pull request`iв",
+      id: "Total PR Digabungkan",
+      my: "Jumlah PR Digabungkan",
+      sk: "Celkový počet zlúčených PR",
+      tr: "Toplam Birleştirilmiş PR",
+      pl: "Łącznie połączonych PR",
+      uz: "Birlangan PR-lar soni",
+      vi: "Tổng Số PR Đã Hợp Nhất",
+      se: "Totalt antal sammanfogade PR",
+    },
+    "statcard.prs-merged-percentage": {
+      ar: "نسبة الطلبات المدمجة",
+      cn: "合并的 PR 百分比",
+      "zh-tw": "合併的 PR 百分比",
+      cs: "Sloučené PRs v procentech",
+      de: "Zusammengeführte PRs in Prozent",
+      en: "Merged PRs Percentage",
+      bn: "PR একত্রীকরণের শতাংশ",
+      es: "Porcentaje de PR fusionados",
+      fr: "Pourcentage de PR fusionnés",
+      hu: "Egyesített PR-k százaléka",
+      it: "Percentuale di PR uniti",
+      ja: "マージされた PR の割合",
+      kr: "병합된 PR의 비율",
+      nl: "Percentage samengevoegde PR's",
+      "pt-pt": "Percentagem de PRs Fundidos",
+      "pt-br": "Porcentagem de PRs Fundidos",
+      np: "PR मर्ज गरिएको प्रतिशत",
+      el: "Ποσοστό Συγχωνευμένων PR",
+      ru: "Процент объединённых pull request`ов",
+      "uk-ua": "Відсоток об'єднаних pull request`iв",
+      id: "Persentase PR Digabungkan",
+      my: "Peratus PR Digabungkan",
+      sk: "Percento zlúčených PR",
+      tr: "Birleştirilmiş PR Yüzdesi",
+      pl: "Procent połączonych PR",
+      uz: "Birlangan PR-lar foizi",
+      vi: "Tỷ Lệ PR Đã Hợp Nhất",
+      se: "Procent av sammanfogade PR",
+    },
   };
 };
 


Test patch:
diff --git a/tests/api.test.js b/tests/api.test.js
index 3c72583..567d2c1 100644
--- a/tests/api.test.js
+++ b/tests/api.test.js
@@ -13,6 +13,8 @@ const stats = {
   totalCommits: 200,
   totalIssues: 300,
   totalPRs: 400,
+  totalPRsMerged: 320,
+  mergedPRsPercentage: 80,
   totalReviews: 50,
   totalDiscussionsStarted: 10,
   totalDiscussionsAnswered: 40,
@@ -41,6 +43,7 @@ const data_stats = {
         totalPullRequestReviewContributions: stats.totalReviews,
       },
       pullRequests: { totalCount: stats.totalPRs },
+      mergedPullRequests: { totalCount: stats.totalPRsMerged },
       openIssues: { totalCount: stats.totalIssues },
       closedIssues: { totalCount: 0 },
       followers: { totalCount: 0 },
diff --git a/tests/fetchStats.test.js b/tests/fetchStats.test.js
index 80b19bf..6db4ef4 100644
--- a/tests/fetchStats.test.js
+++ b/tests/fetchStats.test.js
@@ -16,6 +16,7 @@ const data_stats = {
         totalPullRequestReviewContributions: 50,
       },
       pullRequests: { totalCount: 300 },
+      mergedPullRequests: { totalCount: 240 },
       openIssues: { totalCount: 100 },
       closedIssues: { totalCount: 100 },
       followers: { totalCount: 100 },
@@ -121,6 +122,8 @@ describe("Test fetchStats", () => {
       totalCommits: 100,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 300,
       totalDiscussionsStarted: 10,
@@ -155,6 +158,8 @@ describe("Test fetchStats", () => {
       totalCommits: 100,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 300,
       totalDiscussionsStarted: 10,
@@ -195,6 +200,8 @@ describe("Test fetchStats", () => {
       totalCommits: 1000,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 300,
       totalDiscussionsStarted: 10,
@@ -226,6 +233,8 @@ describe("Test fetchStats", () => {
       totalCommits: 1000,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 200,
       totalDiscussionsStarted: 10,
@@ -255,6 +264,8 @@ describe("Test fetchStats", () => {
       totalCommits: 100,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 400,
       totalDiscussionsStarted: 10,
@@ -284,6 +295,8 @@ describe("Test fetchStats", () => {
       totalCommits: 100,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 300,
       totalDiscussionsStarted: 10,
@@ -313,6 +326,8 @@ describe("Test fetchStats", () => {
       totalCommits: 100,
       totalIssues: 200,
       totalPRs: 300,
+      totalPRsMerged: 240,
+      mergedPRsPercentage: 80,
       totalReviews: 50,
       totalStars: 300,
       totalDiscussionsStarted: 10,
diff --git a/tests/renderStatsCard.test.js b/tests/renderStatsCard.test.js
index 174aa07..fbc02a9 100644
--- a/tests/renderStatsCard.test.js
+++ b/tests/renderStatsCard.test.js
@@ -18,6 +18,8 @@ const stats = {
   totalCommits: 200,
   totalIssues: 300,
   totalPRs: 400,
+  totalPRsMerged: 320,
+  mergedPRsPercentage: 80,
   totalReviews: 50,
   totalDiscussionsStarted: 10,
   totalDiscussionsAnswered: 50,
@@ -52,6 +54,10 @@ describe("Test renderStatsCard", () => {
     expect(
       queryByTestId(document.body, "discussions_answered"),
     ).not.toBeInTheDocument();
+    expect(queryByTestId(document.body, "prs_merged")).not.toBeInTheDocument();
+    expect(
+      queryByTestId(document.body, "prs_merged_percentage"),
+    ).not.toBeInTheDocument();
   });
 
   it("should have proper name apostrophe", () => {
@@ -85,16 +91,24 @@ describe("Test renderStatsCard", () => {
     expect(queryByTestId(document.body, "reviews")).toBeNull();
     expect(queryByTestId(document.body, "discussions_started")).toBeNull();
     expect(queryByTestId(document.body, "discussions_answered")).toBeNull();
+    expect(queryByTestId(document.body, "prs_merged")).toBeNull();
+    expect(queryByTestId(document.body, "prs_merged_percentage")).toBeNull();
   });
 
   it("should show additional stats", () => {
     document.body.innerHTML = renderStatsCard(stats, {
-      show: ["reviews", "discussions_started", "discussions_answered"],
+      show: [
+        "reviews",
+        "discussions_started",
+        "discussions_answered",
+        "prs_merged",
+        "prs_merged_percentage",
+      ],
     });
 
     expect(
       document.body.getElementsByTagName("svg")[0].getAttribute("height"),
-    ).toBe("270");
+    ).toBe("320");
 
     expect(queryByTestId(document.body, "stars")).toBeDefined();
     expect(queryByTestId(document.body, "commits")).toBeDefined();
@@ -104,6 +118,8 @@ describe("Test renderStatsCard", () => {
     expect(queryByTestId(document.body, "reviews")).toBeDefined();
     expect(queryByTestId(document.body, "discussions_started")).toBeDefined();
     expect(queryByTestId(document.body, "discussions_answered")).toBeDefined();
+    expect(queryByTestId(document.body, "prs_merged")).toBeDefined();
+    expect(queryByTestId(document.body, "prs_merged_percentage")).toBeDefined();
   });
 
   it("should hide_rank", () => {