Skip to content

Fixes npm audit findings for serialize-javascript - #120

Merged
gadenbuie merged 2 commits into
mainfrom
fix/npm-audit-mocha-12
Sep 3, 2026
Merged

gadenbuie merged 2 commits into
mainfrom
fix/npm-audit-mocha-12

Conversation

@gadenbuie

Copy link
Copy Markdown
Collaborator

Fixes the npm audit findings for serialize-javascript (GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v).

Summary

  • Bumps mocha to ^12.0.0, the only available fix for the vulnerable serialize-javascript <=7.0.4 it transitively depends on, and includes the transitive dependency updates from npm audit fix. npm audit now reports 0 vulnerabilities.
  • Adapts the test bootstrap (src/test/suite/index.ts) to mocha 12's changed CJS export shape: the Mocha class now lives on .Mocha/.default rather than module.exports itself.
  • All of these are devDependency updates; nothing here ships in the published VSIX, so extension users are unaffected.

Verification

  • npm audit reports 0 vulnerabilities
  • npm test passes locally (6 passing, 1 pending)
  • CI on this PR runs the Extension Tests and Positron API Tests workflows on Linux

serialize-javascript, a transitive dependency of mocha 8.2.0-11.8.0, has
known high-severity vulnerabilities (GHSA-5c6j-r48x-rmvq,
GHSA-qj8w-gfj5-8c6v). Update mocha to v12, which pulls the fixed version,
along with the transitive dependency updates from npm audit fix.

mocha 12 exports the Mocha class on .Mocha/.default instead of as
module.exports itself, so adapt the test bootstrap accordingly.
The mocha 12 export-shape fix missed src/test/positron/index.ts, the
Positron API test bootstrap, which failed CI with 'Mocha is not a
constructor'. Extract the constructor resolution into a shared
src/test/mocha-ctor.ts module used by both bootstraps so they can't
drift apart again.
@gadenbuie
gadenbuie marked this pull request as ready for review September 3, 2026 15:45
@gadenbuie
gadenbuie merged commit 796303c into main Sep 3, 2026
6 checks passed
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.

1 participant