Skip to content

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

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

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

Conversation

@BioPhoton

@BioPhotonBioPhoton commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator

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

nx-cloudBot commented Feb 2, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit da60063

CommandStatusDurationResult
nx run ci:code-pushup -- merge-diffs --files=/h...✅ Succeeded5sView ↗
nx run-many --targets=code-pushup --parallel=fa...✅ Succeeded1m 25sView ↗
nx run-many --targets=code-pushup --parallel=fa...✅ Succeeded12m 47sView ↗
nx run-many -t unit-test,int-test✅ Succeeded3sView ↗

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

@pkg-pr-new

pkg-pr-newBot commented Feb 3, 2026

Copy link
Copy Markdown

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

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 packagesnpm outdated dependencies🟡 78🟡 75↓ −3.1
LighthousePerformance🔴 37🔴 39↑ +2.7
Code coverageCode coverage metrics🟢 93🟢 93↑ +0.1

31 other groups are unchanged.

🛡️ Audits

🔌 Plugin🛡️ Audit📏 Previous value📏 Current value🔄 Value change
LighthouseDefer offscreen images🟨 Potential savings of 16 KiB🟩 0 −∞ %
LighthouseMinify CSS🟨 Potential savings of 10 KiB🟩 0 −∞ %
LighthouseSpeed Index🟥 7.3 s🟥 6.1 s↓ −16.2 %
LighthouseFirst Contentful Paint🟥 3.5 s🟥 3.3 s↓ −5.3 %
JS packagesOutdated npm prod dependencies.🟨 20 outdated package versions (5 major, 11 minor, 4 patch)🟨 20 outdated package versions (6 major, 10 minor, 4 patch) +0 %
LighthouseTotal Blocking Time🟥 1,310 ms🟥 1,230 ms↓ −6.3 %
LighthouseTime to Interactive🟥 13.4 s🟥 13.2 s↓ −1.5 %
Code coverageBranch coverage🟨 89.2 %🟨 89.2 %↑ +0.1 %
LighthouseAvoids enormous network payloads🟩 Total size was 2,119 KiB🟩 Total size was 2,063 KiB↓ −2.6 %
LighthouseUses efficient cache policy on static assets🟨 31 resources found🟨 18 resources found↓ −5.1 %
LighthouseMinimizes main-thread work🟥 10.2 s🟥 8.4 s↓ −17.8 %
LighthouseLargest Contentful Paint🟥 12.3 s🟥 11.9 s↓ −3.7 %
LighthouseServer Backend Latencies🟩 1,220 ms🟩 880 ms↓ −27.7 %
LighthouseJavaScript execution time🟥 3.2 s🟥 2.9 s↓ −8.1 %
LighthouseMetrics🟩 100%🟩 100%↓ −1.5 %
LighthouseReduce unused CSS🟥 Potential savings of 146 KiB🟥 Potential savings of 111 KiB↓ −25 %
LighthouseMax Potential First Input Delay🟥 1,080 ms🟥 950 ms↓ −11.5 %
LighthouseInitial server response time was short🟩 Root document took 560 ms🟩 Root document took 480 ms↓ −14.2 %
LighthouseAvoids 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 %
AxeInteractive controls must not be nested🟩 60 elements🟩 47 elements↓ −21.7 %
AxeElements must only use supported ARIA attributes🟩 100 elements🟩 89 elements↓ −11 %
AxeARIA attributes must be used as specified for the element's role🟩 100 elements🟩 89 elements↓ −11 %
AxeElements must only use permitted ARIA attributes🟩 100 elements🟩 89 elements↓ −11 %
AxeARIA attributes must conform to valid names🟩 100 elements🟩 89 elements↓ −11 %
LighthouseNetwork Round Trip Times🟩 70 ms🟩 70 ms↑ +9.5 %
JS packagesVulnerabilities 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 %
TypeScriptSemantic errors🟥 43 errors🟥 44 errors↑ +2.3 %
Code coverageLine coverage🟩 92.8 %🟩 92.8 %↑ +0.1 %

650 other audits are unchanged.

@github-actions

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

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 coverageCode coverage metrics🟢 94🟢 94↑ +0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin🛡️ Audit📏 Previous value📏 Current value🔄 Value change
Code coverageBranch 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 coverageCode coverage metrics🟢 95🟢 95↑ +0.1
JSDocs coverageDocumentation coverage🟡 61🟡 61↑ +0.1

13 other groups are unchanged.

🛡️ Audits

🔌 Plugin🛡️ Audit📏 Previous value📏 Current value🔄 Value change
Code coverageBranch coverage🟩 91.9 %🟩 91.9 %↑ +0.1 %
Code coverageLine 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 coverageCode coverage metrics🟢 92🟢 92↓ −0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin🛡️ Audit📏 Previous value📏 Current value🔄 Value change
Code coverageLine 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 coverageLine 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 coverageLine coverage🟩 99.8 %🟩 99.8 %↓ −0.1 %

443 other audits are unchanged.


9 other projects are unchanged.

Comment threadpackages/plugin-lighthouse/src/lib/runner/utils.unit.test.ts Outdated
BioPhotonand 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
@BioPhotonBioPhoton self-assigned this Feb 3, 2026

@hanna-skrylhanna-skryl left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
CollaboratorAuthor

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

Comment threadpackages/cli/src/lib/implementation/core-config.middleware.int.test.ts Outdated
@BioPhoton
BioPhoton merged commit 3137af7 into mainFeb 8, 2026
24 checks passed
@BioPhoton
BioPhoton deleted the chore/mock-import-module branch February 8, 2026 17:01
Sign up for freeto 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

@BioPhoton@hanna-skryl