-
Notifications
You must be signed in to change notification settings - Fork 300
fix: update tests for node 22.18.0 #6775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
d89b0f0 to
cffe130
Compare
TICKET: WP-5599
ts-node is no longer maintained, and as such introduces friction with newer versions of nodejs. [Example](nodejs/node#59364) This commit moves to an actively maintained alternative. TICKET: WP-5599 TICKET: WP-5599
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> TICKET: WP-5599
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> TICKET: WP-5599
Modified sinon stubbing approach to work with ESM modules by using require() and monkey patching instead of direct imports, which allows tests to function correctly after migrating from ts-node to tsx. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> TICKET: WP-5599
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> TICKET: WP-5599
Replace sinon.stub() with proxyquire for mocking clientRoutes module imports. This fixes tests now that we use tsx which runs in ESM mode - ES modules are immutable and cannot be modified at runtime, preventing sinon from stubbing them. Proxyquire works by intercepting module resolution at the CommonJS level. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> TICKET: WP-5599
0ca2729 to
8883cf0
Compare
7b24de9 to
cf375c7
Compare
Contributor
Author
|
Audit issues will be addressed separately |
lcovar
approved these changes
Aug 22, 2025
islamaminBitGo
approved these changes
Aug 22, 2025
margueriteblair
approved these changes
Aug 22, 2025
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.
This PR moves our test runners from ts-node to tsx to resolve some issues introduced between ts-node and node 22.18.0.
Details here
Given ts-node is no longer maintained, we are transitioning to TSX.
Due to TSX running tests in ESM mode, opposed to how ts-node ran tests in commonJS mode, a lot of imports and stubbing behaviour had to be fixed.
This does not change the compiled javascript behaviour.
Prior Art
Related Issues
experimental-strip-typesenabled nodejs/node#59364TICKET: WP-5599