Commit d142c58
test_runner: align mock timeout api
Expose Timeout.close() and Timeout[Symbol.dispose]() from MockTimers.
This keeps fake setTimeout() handles aligned with the public
Timeout API so disposal-based patterns do not throw.
Add targeted coverage for Timeout.close() and
Timeout[Symbol.dispose]().
Signed-off-by: sangwook <rewq5991@gmail.com>
PR-URL: #62820
Fixes: #62815
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>1 parent da4dd86 commit d142c58Copy full SHA for d142c58
2 files changed
+39Lines changed: 39 additions & 0 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal/test_runner/mock
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
lib/internal/test_runner/mock/mock_timers.js
Copy file name to clipboardExpand all lines: lib/internal/test_runner/mock/mock_timers.js+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
79 | 79 | |
80 | 80 | |
81 | 81 | |
| 82 | + |
| 83 | + |
82 | 84 | |
83 | 85 | |
84 | 86 | |
85 | 87 | |
86 | 88 | |
87 | 89 | |
| 90 | + |
88 | 91 | |
89 | 92 | |
90 | 93 | |
| ||
102 | 105 | |
103 | 106 | |
104 | 107 | |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
105 | 117 | |
106 | 118 | |
107 | 119 | |
| ||
329 | 341 | |
330 | 342 | |
331 | 343 | |
| 344 | + |
332 | 345 | |
333 | 346 | |
334 | 347 | |
|
Collapse file
test/parallel/test-runner-mock-timers.js
Copy file name to clipboardExpand all lines: test/parallel/test-runner-mock-timers.js+26Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
266 | 266 | |
267 | 267 | |
268 | 268 | |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
| 285 | + |
| 286 | + |
| 287 | + |
| 288 | + |
| 289 | + |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | + |
| 294 | + |
269 | 295 | |
270 | 296 | |
271 | 297 | |
|
0 commit comments