test_runner: add support for mocking setImmediate timer
This PR adds support for
-
- setImmediate
-
- timers.setImmediate
-
- timers.promises.setImmediate
This PR makes sure that setImmediate
has priority higher than setTimeout
and follows the spec defined in the docs about:
When multiple calls to setImmediate() are made, the callback functions are queued for execution in the order in which they are created
cc: @nodejs/test_runner