externalClock
Index
Constructors
externalconstructor
Parameters
externalcheckTime: () => Date = ...
Returns Clock
Methods
externaltoJSON
Returns JSONObject
externalsetAhead
Sets the clock ahead to force early resolution of promises returned by
Clock.waitFor
.Useful for test purposes to avoid unnecessary delays.
Parameters
externalduration: Duration
Returns void
externaltick
Returns a Promise that resolves after one tick of the clock.
Useful for test purposes to avoid unnecessary delays.
Returns Promise<void>
externalnow
Returns current time
Returns Timestamp
externalwaitFor
Returns a Promise that will be resolved after the given duration
Parameters
externalduration: Duration
Returns Promise<void>
A
Clock
tells the time. This abstraction allows Serenity/JS to have a single place in the framework responsible for telling the time, and one that can be easily mocked for internal testing.Learn more
Timestamp
Duration