Skip to content

chore: migrate Jest from v29 to v30#7905

Draft
cryptodev-2s wants to merge 1 commit intomainfrom
chore/upgrade-jest-v29-to-v30
Draft

chore: migrate Jest from v29 to v30#7905
cryptodev-2s wants to merge 1 commit intomainfrom
chore/upgrade-jest-v29-to-v30

Conversation

@cryptodev-2s
Copy link
Contributor

Explanation

  • Update jest to ^30.2.0, @types/jest to ^30.0.0, jest-silent-reporter to ^0.6.0, ts-jest to ^29.4.6 across all packages
  • Update jest-environment-jsdom to ^30.2.0, jest-when to ^3.7.0, jest-it-up to ^4.0.1 where used
  • Remove prettier-2 alias and prettierPath config (Jest 30 supports Prettier 3 natively)
  • Replace jest.SpyInstance with jest.SpiedFunction (46 occurrences across 22 files)
  • Fix toThrow() assertions for Jest 30's stricter error comparison in eth-json-rpc-provider, eth-json-rpc-middleware, and permission-controller
  • Fix foundryup os module mocking for Jest 30's node: prefix handling and resetMocks interaction
  • Add lavamoat allowScripts entry for unrs-resolver

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@socket-security
Copy link

socket-security bot commented Feb 11, 2026

@socket-security
Copy link

socket-security bot commented Feb 11, 2026

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
Potential code anomaly (AI signal): npm @napi-rs/wasm-runtime is 100.0% likely to have a medium risk anomaly

Notes: The fragment appears to implement a substantial WASI/N-API bridge with comprehensive memory and filesystem interfacing. There is no concrete evidence of malicious payloads such as data exfiltration, backdoors, or remote command execution in this snippet. The primary concerns relate to the unusual in-browser input path (readStdin) and the large surface area for data flows across threads and FFI boundaries. A targeted, broader audit of the complete module and any wasm payloads loaded through these bindings is recommended to ensure rights enforcement and memory safety. Overall risk is moderate but current evidence does not indicate active malware.

Confidence: 1.00

Severity: 0.60

From: ?npm/[email protected]npm/@napi-rs/[email protected]

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@napi-rs/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm @ungap/structured-clone is 100.0% likely to have a medium risk anomaly

Notes: The code correctly reconstructs many built-in JS types and is functionally reasonable for trusted serialized inputs. However it performs dynamic constructor invocation using new envtype and env[name] for Error types without an allowlist or validation. If an attacker can control the serialized input, they can request instantiation of arbitrary global constructors (e.g., Function) or cause prototype pollution via crafted object keys, enabling code execution or other dangerous behavior. The module should only be used with trusted inputs or modified to restrict allowed constructor names and to guard against prototype pollution.

Confidence: 1.00

Severity: 0.60

From: ?npm/[email protected]npm/@ungap/[email protected]

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@ungap/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm jsdom is 100.0% likely to have a medium risk anomaly

Notes: The code fragment does not exhibit clear malicious behavior, but it has several anomalies, including typos and dynamic property manipulation using Reflect API, which could pose a security risk if not properly managed.

Confidence: 1.00

Severity: 0.60

From: ?npm/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm jsdom is 100.0% likely to have a medium risk anomaly

Notes: The code uses new Function() and createFunction() to dynamically create and execute code, which can be dangerous if not properly controlled. The use of with statements and dynamic function creation is similar to using eval(), which is generally discouraged due to security risks. If user input is passed into the event handler bodies, it could lead to cross-site scripting (XSS) vulnerabilities.

Confidence: 1.00

Severity: 0.60

From: ?npm/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Ignoring alerts on:

View full report

@cryptodev-2s cryptodev-2s force-pushed the chore/upgrade-jest-v29-to-v30 branch 3 times, most recently from 45b6b3f to c9515d1 Compare February 11, 2026 19:24
@cryptodev-2s cryptodev-2s force-pushed the chore/upgrade-jest-v29-to-v30 branch 5 times, most recently from f81433b to 54d8ef9 Compare February 11, 2026 21:05
@cryptodev-2s
Copy link
Contributor Author

@SocketSecurity ignore npm/[email protected]
@SocketSecurity ignore npm/@asamuzakjp/[email protected]
@SocketSecurity ignore npm/@emnapi/[email protected]
@SocketSecurity ignore npm/@tybys/[email protected]
@SocketSecurity ignore npm/@unrs/[email protected]
@SocketSecurity ignore npm/[email protected]
@SocketSecurity ignore npm/[email protected]

@cryptodev-2s cryptodev-2s force-pushed the chore/upgrade-jest-v29-to-v30 branch 2 times, most recently from 602bfb0 to 67ff9f6 Compare February 11, 2026 21:59
- Update jest to ^30.2.0, @types/jest to ^30.0.0, jest-silent-reporter
  to ^0.6.0, ts-jest to ^29.4.6 across all packages
- Update jest-environment-jsdom to ^30.2.0, jest-when to ^3.7.0,
  jest-it-up to ^4.0.1 where used
- Remove prettier-2 alias and prettierPath config (Jest 30 supports
  Prettier 3 natively)
- Replace jest.SpyInstance with jest.SpiedFunction (46 occurrences
  across 22 files)
- Fix toThrow() assertions for Jest 30's stricter error comparison
  in eth-json-rpc-provider, eth-json-rpc-middleware, and
  permission-controller
- Fix foundryup os module mocking for Jest 30's node: prefix handling
  and resetMocks interaction
- Add lavamoat allowScripts entry for unrs-resolver
@cryptodev-2s cryptodev-2s force-pushed the chore/upgrade-jest-v29-to-v30 branch from 67ff9f6 to a3ee1ab Compare February 12, 2026 12:44
Sign up for free to 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.

1 participant