From 67925bb9145825c719c956d567ef3b2007a5eaea Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Thu, 29 Jun 2023 10:45:44 +0300 Subject: [PATCH] test: add Symbol.dispose support to mock timers PR-URL: https://github.com/nodejs/node/pull/48549 Reviewed-By: Colin Ihrig Reviewed-By: Moshe Atlow Reviewed-By: Antoine du Hamel Reviewed-By: Erick Wendel --- doc/api/test.md | 4 ++++ lib/internal/test_runner/mock/mock_timers.js | 5 +++++ test/parallel/test-runner-mock-timers.js | 15 +++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/doc/api/test.md b/doc/api/test.md index c45eb183caabd7..a4936c0b72c35e 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -1587,6 +1587,10 @@ const { mock } = require('node:test'); mock.timers.reset(); ``` +### `timers[Symbol.dispose]()` + +Calls `timers.reset()`. + ### `timers.tick(milliseconds)`