Repository navigation
Conversation
Regenerating package-lock.json let the hoisted mocha float from 11.8.0 to
12.0.0. Nothing in the repo declared mocha directly — it was only present
because npm auto-installs mochawesome's `mocha: ">=7"` peer dependency.
mocha 12 replaced lib/utils.js with a lib/utils/ directory that has no
index, so mochawesome@7.1.4's `require('mocha/lib/utils')` fails and mocha
aborts before running a single test:
Cannot find module 'mocha/lib/utils'
ERROR: TypeError: Could not load reporter "mochawesome"
subscription-service and tenant-management-service both set
"reporter": "mochawesome" in .mocharc.json, so their suites never ran.
Declaring mocha as a root devDependency pins it and re-dedupes
@loopback/build back onto the single hoisted copy. An overrides entry does
not work here, as npm ignores it for an auto-installed peer. Upgrading
mochawesome does not help either — 8.0.1 still requires mocha/lib/utils.
npm run test --workspaces: 116 passing (4 orchestrator, 36 subscription,
76 tenant-management).
Refs GH-132
|
piyushsinghgaur1
requested review from
a-ganguly,
rohit-sourcefuse and
yeshamavani
September 10, 2026 06:07
a-ganguly
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Refreshes
package-lock.jsonto pull in patched versions of dependencies flagged by the Trivy scan (.github/workflows/trivy.yml, which gates onHIGH/CRITICALwithignore-unfixed: true).Against
master: 113 distinct packages changed version (116 lockfile entries), 6 added, 9 removed.One
package.jsonchange accompanies the lockfile —mochaadded to rootdevDependencies— explained below. No existing dependency range was modified, so no direct dependency contract changes.Why
mochawas added todevDependenciesRegenerating the lockfile broke the test job on every service. This pin is the fix, not a new dependency.
What broke. Nothing in this repo declared
mochadirectly. It was only in the tree because npm auto-installs peer dependencies, andmochawesomedeclaresmocha: ">=7". That left the hoisted copy free to float, and the regen moved it from11.8.0to12.0.0.mocha 12 replaced
lib/utils.jswith alib/utils/directory that contains no index.mochawesome@7.1.4still doesrequire('mocha/lib/utils')(src/utils.js:6), so the reporter fails to load and mocha aborts before running a single test:Both
subscription-serviceandtenant-management-serviceset"reporter": "mochawesome"in.mocharc.json, so their suites never ran at all.The fix. Declaring
mocha: "^11.8.0"as a root devDependency pins it and re-dedupes@loopback/build(which wants^11.8.0) back onto the single hoisted copy. The resolved version is11.8.0— identical tomaster, so this restores master's tree rather than changing it. It makes an already-load-bearing dependency explicit instead of leaving it to peer auto-install.Two alternatives were tried and rejected:
overridesentry does not work. npm ignoresoverridesfor an auto-installed peer; the lock still resolved mocha 12.mochawesomedoes not help. The current 8.0.1 still contains the samerequire('mocha/lib/utils')line.Notable bumps
axiosbody-parserqsundicinanoidsocksjs-yamlpgfast-xml-parsermorganexpress-rate-limitstrong-error-handlerloopback-connector@loopback/*@aws-sdk/*/@smithy/*nx/@nx/*Two type-only downgrades appear in the diff and are worth flagging for reviewers:
@types/node26.1.2 → 22.20.2 andundici-types8.3.0 → 6.21.0.@types/node22.x is the correct line for this repo's"node": "22 || 24"engines; build and lint pass on it.Type of change
How Has This Been Tested?
npm run test --workspaces— 116 passing (4 orchestrator, 36 subscription, 76 tenant-management), 0 failingnpm run lint --workspaces— eslint + prettier cleannpm ls --depth=0— dependency tree resolves cleanly against the new lockfilemochaconfirmed at 11.8.0, deduped to a single hoisted copynpm auditreviewed before/after; remaining HIGH/CRITICAL items are dev-only and unfixed upstreamChecklist: