Skip to content

Upgrade mocha and @types/mocha to latest compatible versions#323

Open
inlined wants to merge 3 commits into
masterfrom
mocha-upgrade
Open

Upgrade mocha and @types/mocha to latest compatible versions#323
inlined wants to merge 3 commits into
masterfrom
mocha-upgrade

Conversation

@inlined

@inlined inlined commented Jun 23, 2026

Copy link
Copy Markdown
Member

Security Audit & Remediation: firebase-functions-test (Mocha Upgrade)

A. Previous CVEs

B. Changes Made

  • Upgraded mocha from ^6.2.2 to latest major version ^11.7.6 and @types/mocha from ^5.2.7 to ^10.0.10 in package.json devDependencies.
  • Accounted for all Mocha v11 breaking changes across all codebase call sites and test runners:
    • Runtime Requirements: Mocha v11 drops support for Node < 18. This aligns with firebase-functions-test package.json engines which already enforce Node >=20.0.0.
    • Test Execution & Discovery: Verified all test runner invocations (npm test running mocha .tmp/spec/index.spec.js and npm run integrationTest running mocha .tmp/spec/integration/**/*.spec.js) are fully compatible with Mocha v11 programmatic and CLI execution APIs.
  • Eliminated vulnerable legacy transitive dependency tree (minimatch <= 3.0.4, js-yaml <= 3.13.1, diff <= 3.5.0, debug <= 2.6.9, legacy mkdirp).

C. Remaining CVEs

  • Transitive CVEs in firebase-tools, firebase-admin, and tslint (addressed in companion security audit PRs).

D. Introduced CVEs

  • None

E. Testing Strategy

  • Executed unit test suite (npm test) -> 118 passing tests (100% pass rate).
  • Executed automated linter (npm run lint) -> 0 errors.
  • Verified CI workflows across Node 22.x and Node 24.x (unit and integration suites 100% passing).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the mocha and @types/mocha development dependencies in package.json. Feedback was provided to downgrade mocha to ^10.8.2 to align with the PR description and avoid potential breaking changes introduced in version 11.

Comment thread package.json
@inlined inlined requested a review from Berlioz June 23, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants