Title: test_runner: add mock-timers support for AbortSignal.timeout by DeveloperViraj · Pull Request #60751 · nodejs/node · GitHub
Open Graph Title: test_runner: add mock-timers support for AbortSignal.timeout by DeveloperViraj · Pull Request #60751 · nodejs/node
X Title: test_runner: add mock-timers support for AbortSignal.timeout by DeveloperViraj · Pull Request #60751 · nodejs/node
Description: Fixes: #60509 This PR completes the fix for making AbortSignal.timeout() compatible with the test runner's mock timers, and adds a regression test to ensure correct behavior going forward. What’s included 1. Mock timers fix Added "AbortSignal.timeout" as a discrete mock-timers API target. Implemented dedicated store/restore handlers for the original AbortSignal.timeout property (no silent failures). Integrated the mock implementation into the toFake/toReal paths to match the design of other mockable timer APIs. Restored documentation comments and internal validation that were unintentionally removed earlier. 2. New regression test Added test/parallel/test-mock-timers-abortsignal-timeout.js Verifies that: enabling mock timers with { apis: ['AbortSignal.timeout'] } works mock.tick() correctly triggers abortion after the expected delay Notes I created a fresh branch to ensure a clean diff without unrelated changes and to fully incorporate the feedback from @Renegade334 and @ErickWendel. Please let me know if you'd like any adjustments to the test or implementation. Thanks for the clear guidance and review support
Open Graph Description: Fixes: #60509 This PR completes the fix for making AbortSignal.timeout() compatible with the test runner's mock timers, and adds a regression test to ensure correct behavior going forward. What...
X Description: Fixes: #60509 This PR completes the fix for making AbortSignal.timeout() compatible with the test runner's mock timers, and adds a regression test to ensure correct behavior going forward. ...
Opengraph URL: https://github.com/nodejs/node/pull/60751
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d83025b8-74da-9858-8145-b144c7912bf4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D59E:142B17:E5954E:1427E3A:6A4CAE81 |
| html-safe-nonce | 5f8f331e288725514d8c556558e0124e7a9ec4e99aac620cfb70e0e43d899bdc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTlFOjE0MkIxNzpFNTk1NEU6MTQyN0UzQTo2QTRDQUU4MSIsInZpc2l0b3JfaWQiOiI0ODQwNjcxNjM4OTU2MzIyNDMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a8d1987920f30b800f2351d761517fcdbfa80705eb95d9c15e2082437f27b847 |
| hovercard-subject-tag | pull_request:3015416655 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/60751/files |
| twitter:image | https://avatars.githubusercontent.com/u/203398049?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/203398049?s=400&v=4 |
| og:image:alt | Fixes: #60509 This PR completes the fix for making AbortSignal.timeout() compatible with the test runner's mock timers, and adds a regression test to ensure correct behavior going forward. What... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width