Skip to content

chore: mock import module in favour of bundle require#1234

Merged
BioPhoton merged 11 commits intomainfrom
chore/mock-import-module
Feb 8, 2026
Merged

chore: mock import module in favour of bundle require#1234
BioPhoton merged 11 commits intomainfrom
chore/mock-import-module

Conversation

@BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Feb 2, 2026

This PR includes:

  • mock importModule instead of bundleRequire to isolate the 3rd party lib in our codebase
  • duplicate config files to stop relying on centralised test fixtures
  • reduce tests in cli to minimum.

Problem:
Having a centralised mock folder makes it hard to maintain tests as we can’t easily tell who uses them. Furthermore adding different test fixtures in the same shared project introduces unnecessary dependency to projects.

@nx-cloud
Copy link

nx-cloud bot commented Feb 2, 2026

View your CI Pipeline Execution ↗ for commit da60063

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 25s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 12m 47s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-08 12:50:57 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 3, 2026

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1234

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1234

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1234

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1234

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1234

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1234

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1234

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1234

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1234

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1234

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1234

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1234

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1234

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1234

commit: da60063

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 490bec9 with previous commit 3dbf378.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Updates 🟡 78 🟡 75 ↓ −3.1
Performance 🔴 37 🔴 39 ↑ +2.7
Code coverage 🟢 93 🟢 93 ↑ +0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Security 🔴 47 🔴 47
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Documentation 🟡 53 🟡 53
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👍 2 groups improved, 👎 1 group regressed, 👍 7 audits improved, 👎 1 audit regressed, 21 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JS packages npm outdated dependencies 🟡 78 🟡 75 ↓ −3.1
Lighthouse Performance 🔴 37 🔴 39 ↑ +2.7
Code coverage Code coverage metrics 🟢 93 🟢 93 ↑ +0.1

31 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Defer offscreen images 🟨 Potential savings of 16 KiB 🟩 0  −∞ %
Lighthouse Minify CSS 🟨 Potential savings of 10 KiB 🟩 0  −∞ %
Lighthouse Speed Index 🟥 7.3 s 🟥 6.1 s ↓ −16.2 %
Lighthouse First Contentful Paint 🟥 3.5 s 🟥 3.3 s ↓ −5.3 %
JS packages Outdated npm prod dependencies. 🟨 20 outdated package versions (5 major, 11 minor, 4 patch) 🟨 20 outdated package versions (6 major, 10 minor, 4 patch)  +0 %
Lighthouse Total Blocking Time 🟥 1,310 ms 🟥 1,230 ms ↓ −6.3 %
Lighthouse Time to Interactive 🟥 13.4 s 🟥 13.2 s ↓ −1.5 %
Code coverage Branch coverage 🟨 89.2 % 🟨 89.2 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,119 KiB 🟩 Total size was 2,063 KiB ↓ −2.6 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 18 resources found ↓ −5.1 %
Lighthouse Minimizes main-thread work 🟥 10.2 s 🟥 8.4 s ↓ −17.8 %
Lighthouse Largest Contentful Paint 🟥 12.3 s 🟥 11.9 s ↓ −3.7 %
Lighthouse Server Backend Latencies 🟩 1,220 ms 🟩 880 ms ↓ −27.7 %
Lighthouse JavaScript execution time 🟥 3.2 s 🟥 2.9 s ↓ −8.1 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −1.5 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 146 KiB 🟥 Potential savings of 111 KiB ↓ −25 %
Lighthouse Max Potential First Input Delay 🟥 1,080 ms 🟥 950 ms ↓ −11.5 %
Lighthouse Initial server response time was short 🟩 Root document took 560 ms 🟩 Root document took 480 ms ↓ −14.2 %
Lighthouse Avoids an excessive DOM size 🟥 2,366 elements 🟥 2,327 elements ↓ −1.6 %
Axe <li> elements must be contained in a <ul> or <ol> 🟩 65 elements 🟩 52 elements ↓ −20 %
Axe Interactive controls must not be nested 🟩 60 elements 🟩 47 elements ↓ −21.7 %
Axe Elements must only use supported ARIA attributes 🟩 100 elements 🟩 89 elements ↓ −11 %
Axe ARIA attributes must be used as specified for the element's role 🟩 100 elements 🟩 89 elements ↓ −11 %
Axe Elements must only use permitted ARIA attributes 🟩 100 elements 🟩 89 elements ↓ −11 %
Axe ARIA attributes must conform to valid names 🟩 100 elements 🟩 89 elements ↓ −11 %
Lighthouse Network Round Trip Times 🟩 70 ms 🟩 70 ms ↑ +9.5 %
JS packages Vulnerabilities for npm dev dependencies. 🟥 47 vulnerabilities (3 critical, 9 high, 32 moderate, 3 low) 🟥 48 vulnerabilities (3 critical, 9 high, 32 moderate, 4 low) ↑ +2.1 %
TypeScript Semantic errors 🟥 43 errors 🟥 44 errors ↑ +2.3 %
Code coverage Line coverage 🟩 92.8 % 🟩 92.8 % ↑ +0.1 %

650 other audits are unchanged.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 490bec9 with previous commit 3dbf378.

💼 Project cli

🥳 Code PushUp report has improved.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage 🟢 94 🟢 94 ↑ +0.1

5 other categories are unchanged.

👍 1 group improved, 👍 1 audit improved

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage Code coverage metrics 🟢 94 🟢 94 ↑ +0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Branch coverage 🟨 86.9 % 🟨 87.3 % ↑ +0.4 %

443 other audits are unchanged.

💼 Project utils

🥳 Code PushUp report has improved.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage 🟢 95 🟢 95 ↑ +0.1
Documentation 🟡 61 🟡 61 ↑ +0.1

4 other categories are unchanged.

👍 2 groups improved, 👍 1 audit improved, 1 audit changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage Code coverage metrics 🟢 95 🟢 95 ↑ +0.1
JSDocs coverage Documentation coverage 🟡 61 🟡 61 ↑ +0.1

13 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Branch coverage 🟩 91.9 % 🟩 91.9 % ↑ +0.1 %
Code coverage Line coverage 🟩 97.8 % 🟩 97.8 % ↑ +0.1 %

442 other audits are unchanged.

💼 Project plugin-coverage

😟 Code PushUp report has regressed.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage 🟢 92 🟢 92 ↓ −0.1

5 other categories are unchanged.

👎 1 group regressed, 👎 1 audit regressed

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Code coverage Code coverage metrics 🟢 92 🟢 92 ↓ −0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Line coverage 🟨 89.1 % 🟨 89.1 % ↓ −0.1 %

443 other audits are unchanged.

💼 Project core

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

All of 6 categories are unchanged.

1 audit changed without impacting score

🗃️ Groups

All of 15 groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Line coverage 🟩 94.8 % 🟩 94.8 % ↓ −0.1 %

443 other audits are unchanged.

💼 Project plugin-lighthouse

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

All of 6 categories are unchanged.

1 audit changed without impacting score

🗃️ Groups

All of 15 groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Code coverage Line coverage 🟩 99.8 % 🟩 99.8 % ↓ −0.1 %

443 other audits are unchanged.


9 other projects are unchanged.

BioPhoton and others added 3 commits February 3, 2026 19:02
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
@BioPhoton BioPhoton enabled auto-merge (squash) February 3, 2026 18:49
@BioPhoton BioPhoton requested a review from hanna-skryl February 3, 2026 18:52
@BioPhoton BioPhoton self-assigned this Feb 3, 2026
Copy link
Collaborator

@hanna-skryl hanna-skryl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the problem with the centralized fixtures in testing/test-fixtures? The PR description says "stop relying on centralised test fixtures," but doesn't explain what issue that caused. Now the same config exists in both cli/mocks and core/mocks, so if the schema changes, both need to be updated separately.

@BioPhoton
Copy link
Collaborator Author

@hanna-skryl i updated the pr description. I will also go ahead and reduce the tests in CLI as mentioned above.

@BioPhoton BioPhoton requested a review from hanna-skryl February 3, 2026 21:14
@BioPhoton BioPhoton requested a review from hanna-skryl February 8, 2026 12:34
@BioPhoton BioPhoton merged commit 3137af7 into main Feb 8, 2026
24 checks passed
@BioPhoton BioPhoton deleted the chore/mock-import-module branch February 8, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants