Skip to content

Commit

Permalink
test(utils): use file snapshots for Markdown and stdout text
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Mar 13, 2024
1 parent 7ef44c7 commit da9f620
Show file tree
Hide file tree
Showing 13 changed files with 1,135 additions and 1,148 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
/.nx/cache
__snapshots__

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Code PushUp

🙌 Code PushUp report has **improved** – compared target commit `0123456` with source commit `abcdef0`.

## 🏷️ Categories

|🏷️ Category|⭐ Current score|⭐ Previous score|🗠 Score change|
|:--|:--:|:--:|:--:|
|Performance|🟢 **94**|🟢 92|<span style="color: green">▲ **+2**</span>|
|Bug prevention|🟢 **95**|🟡 68|<span style="color: green">▲ **+27**</span>|
|Code style|🟢 **100**|🟡 54|<span style="color: green">▲ **+46**</span>|

## 🎗️ Groups

<details>
<summary>👍 <strong>2</strong> groups improved</summary>

|🔌 Plugin|🎗️ Group|⭐ Current score|⭐ Previous score|🗠 Score change|
|:--|:--|:--:|:--:|:--:|
|ESLint|Maximum lines limitation|🟢 **100**|🟡 50|<span style="color: green">▲ **+50**</span>|
|Lighthouse|Performance|🟢 **94**|🟢 92|<span style="color: green">▲ **+2**</span>|

</details>


## 🛡️ Audits

<details>
<summary>👍 <strong>12</strong> audits improved</summary>

|🔌 Plugin|🛡️ Audit|📏 Current value|📏 Previous value|🗠 Value change|
|:--|:--|:--:|:--:|:--:|
|ESLint|Disallow unused variables|🟩 **passed**|🟥 1 warning|<span style="color: green">▼ **-100%**</span>|
|ESLint|Require braces around arrow function bodies|🟩 **passed**|🟥 1 warning|<span style="color: green">▼ **-100%**</span>|
|ESLint|Require the use of `===` and `!==`|🟩 **passed**|🟥 1 warning|<span style="color: green">▼ **-100%**</span>|
|ESLint|Enforce a maximum number of lines of code in a function|🟩 **passed**|🟥 1 warning|<span style="color: green">▼ **-100%**</span>|
|ESLint|Disallow variable declarations from shadowing variables declared in the outer scope|🟩 **passed**|🟥 3 warnings|<span style="color: green">▼ **-100%**</span>|
|ESLint|Require or disallow method and property shorthand syntax for object literals|🟩 **passed**|🟥 3 warnings|<span style="color: green">▼ **-100%**</span>|
|ESLint|Require `const` declarations for variables that are never reassigned after declared|🟩 **passed**|🟥 1 warning|<span style="color: green">▼ **-100%**</span>|
|ESLint|Disallow missing `key` props in iterators/collection literals|🟩 **passed**|🟥 1 warning|<span style="color: green">▼ **-100%**</span>|
|ESLint|verifies the list of dependencies for Hooks like useEffect and similar|🟩 **passed**|🟥 2 warnings|<span style="color: green">▼ **-100%**</span>|
|Lighthouse|First Contentful Paint|🟨 **1.1 s**|🟨 1.2 s|<span style="color: green">▼ **-4%**</span>|
|Lighthouse|Largest Contentful Paint|🟨 **1.4 s**|🟨 1.5 s|<span style="color: green">▼ **-8%**</span>|
|Lighthouse|Speed Index|🟩 **1.1 s**|🟩 1.2 s|<span style="color: green">▼ **-4%**</span>|

40 other audits are unchanged.

</details>
48 changes: 48 additions & 0 deletions packages/utils/src/lib/reports/__snapshots__/report-diff-mixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Code PushUp

😐 Code PushUp report has both **improved and regressed** – compared target commit `0123456` with source commit `abcdef0`.

## 🏷️ Categories

|🏷️ Category|⭐ Current score|⭐ Previous score|🗠 Score change|
|:--|:--:|:--:|:--:|
|Performance|🟢 **94**|🟢 92|<span style="color: green">▲ **+2**</span>|
|Bug prevention|🟡 **63**|🟡 68|<span style="color: red">▼ **-5**</span>|

<details>
<summary>1 other category is unchanged.</summary>

- Code style: 🟡 **54**

</details>


## 🎗️ Groups

<details>
<summary>👍 <strong>1</strong> group improved</summary>

|🔌 Plugin|🎗️ Group|⭐ Current score|⭐ Previous score|🗠 Score change|
|:--|:--|:--:|:--:|:--:|
|Lighthouse|Performance|🟢 **94**|🟢 92|<span style="color: green">▲ **+2**</span>|

1 other group is unchanged.

</details>


## 🛡️ Audits

<details>
<summary>👍 <strong>3</strong> audits improved, 👎 <strong>1</strong> audit regressed</summary>

|🔌 Plugin|🛡️ Audit|📏 Current value|📏 Previous value|🗠 Value change|
|:--|:--|:--:|:--:|:--:|
|ESLint|Disallow unused variables|🟥 **1 error**|🟩 passed|<span style="color: red">▲ **+∞%**</span>|
|Lighthouse|First Contentful Paint|🟨 **1.1 s**|🟨 1.2 s|<span style="color: green">▼ **-4%**</span>|
|Lighthouse|Largest Contentful Paint|🟨 **1.4 s**|🟨 1.5 s|<span style="color: green">▼ **-8%**</span>|
|Lighthouse|Speed Index|🟩 **1.1 s**|🟩 1.2 s|<span style="color: green">▼ **-4%**</span>|

48 other audits are unchanged.

</details>
Loading

0 comments on commit da9f620

Please sign in to comment.