Fixes npm audit findings for serialize-javascript - #120
Merged
Merged
Conversation
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
marked this pull request as ready for review
September 3, 2026 15:45
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.
Fixes the npm audit findings for
serialize-javascript(GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v).Summary
mochato^12.0.0, the only available fix for the vulnerableserialize-javascript <=7.0.4it transitively depends on, and includes the transitive dependency updates fromnpm audit fix.npm auditnow reports 0 vulnerabilities.src/test/suite/index.ts) to mocha 12's changed CJS export shape: theMochaclass now lives on.Mocha/.defaultrather thanmodule.exportsitself.Verification
npm auditreports 0 vulnerabilitiesnpm testpasses locally (6 passing, 1 pending)