Skip to content

test(base-contract-io): pass real ethers exports through module mock - #971

Merged
sloops77 merged 1 commit into
mainfrom
fix/base-contract-io-node-24-21-mock
Oct 16, 2026
Merged

sloops77 merged 1 commit into
mainfrom
fix/base-contract-io-node-24-21-mock

Conversation

@sloops77

Copy link
Copy Markdown
Contributor

Summary

  • Fixes main's nightly Node.js CI, which has failed since about 2026-09-23 in Test (@verii/base-contract-io) with TypeError: Class extends value undefined is not a constructor or null.
  • Cause: Node 24.21.0 (test_runner: mock dual-package with conditional exports nodejs/node#62943) makes mock.module() also intercept require() of dual CJS/ESM packages. CI uses node-version: 24.x, so it picked this up automatically.
  • test/mock-contract.test.js (its suite is describe.skip) mocks ethers with only { Wallet, Contract }. On 24.21 that mock reaches src/resyncing-nonce-manager.js, so extends ethers.NonceManager throws when the file loads.
  • Fix: spread the real ethers exports into the mock, as blockchain-functions/test/eth.test.js already does. Test-only change.
  • Also unblocks Renovate PRs fix(deps): update aws-sdk-js-v3 monorepo to v3.1150.0 #950 and chore(deps): lock file maintenance #949, which fail on the same job.

Test plan

  • Verified locally on Node 24.20.0, 24.21.0 and 24.22.0
  • CI green

🤖 Generated with Claude Code

Node 24.21.0 (nodejs/node#62943) makes mock.module() also intercept
require() of dual CJS/ESM packages. The skipped mock-contract suite
replaced ethers with only { Wallet, Contract }, so loading
resyncing-nonce-manager.js threw 'Class extends value undefined'
when extending ethers.NonceManager, failing main's nightly CI since
the runners picked up 24.21.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Andres Olave <[email protected]>
@sloops77
sloops77 requested a review from a team as a code owner October 16, 2026 01:16
Copilot AI balanced review requested due to automatic review settings October 16, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor
TestsPassed ✅Skipped ⚠️Failed
Test Results2426 ran2422 passed4 skipped0 failed
TestResult
No test annotations available

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Coverage Summary (PR)

Worst 4 packages by coverage

Package Coverage Covered / Total
@verii/base-contract-io 98.88% 616 / 623

Worst 2 files by uncovered lines

  • Coverage file table not found in summary output.

View full coverage report

@sloops77
sloops77 merged commit 6395aee into main Oct 16, 2026
@sloops77
sloops77 deleted the fix/base-contract-io-node-24-21-mock branch October 16, 2026 01:42
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