Skip to content

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-test

Or install the full bundle:

bash
npm i @litert/utils

And 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

FunctionDescription
autoTickAdvances mocked timers via runAll() on every event loop tick until the task settles.
autoTickMsAdvances 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.

TypeDescription
IAutoTickMsOptionsOptions for autoTickMs.