Namespace Test
Package: @litert/utils-test
Test helper utilities for the Node.js built-in test runner (node:test). Provides functions that automatically advance mocked timers so that timer-dependent async tests complete instantly without real delays.
Install
Use this namespace only:
bash
npm i @litert/utils-testOr install the full bundle:
bash
npm i @litert/utilsAnd then import from it.
ts
import * as LibUtils from '@litert/utils';
await LibUtils.Test.autoTick(myTimerTask);
// or
import { Test as LibTest } from '@litert/utils';
await LibTest.autoTick(myTimerTask);Functions
| Function | Description |
|---|---|
autoTick | Advances mocked timers via runAll() on every event loop tick until the task settles. |
autoTickMs | Advances the mocked clock by a fixed interval (tickMs) per event loop tick until the task settles. |
Typings
See Typings.md for all exported interfaces and type aliases.
| Type | Description |
|---|---|
IAutoTickMsOptions | Options for autoTickMs. |