From 46757ea93cdff02a80039c923e919edf046b7a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Thu, 22 Aug 2024 21:09:39 +0200 Subject: [PATCH] docs(website): Clarify that time control also works for dates --- docs/website/docs/features/time.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/website/docs/features/time.md b/docs/website/docs/features/time.md index 51c12c3..77efa3e 100644 --- a/docs/website/docs/features/time.md +++ b/docs/website/docs/features/time.md @@ -1,8 +1,9 @@ -# Time control +# Date and time control Tests run in virtual time: a fixed timescale which is controlled by the developer. The current virtual time can be accessed using the [`time.nowMillis`](https://opensavvy.gitlab.io/groundwork/prepared/api-docs/suite/opensavvy.prepared.suite/now-millis.html) property. +To control the current date as proper datetime types, or to inject a controllable clock into other services, see [Using the virtual time](#using-the-virtual-date-and-time). ## Delay-skipping @@ -111,7 +112,7 @@ test("Measure how long an operation takes in real time") { } ``` -## Using the virtual time +## Using the virtual date and time Often, `time.nowMillis` is insufficient: we want to trigger algorithms at specific dates in time, for example to check that an algorithm behaves correctly even at midnight on New Year's. Prepared offers compatibility modules to generate datetime objects from popular libraries. -- 2.51.2