From a4d75d8503f9ed5eead755fbaf71a523c29b6ea8 Mon Sep 17 00:00:00 2001 From: Philipp Fritsche Date: Thu, 7 Apr 2022 10:47:36 +0000 Subject: [PATCH 1/2] docs(user-event): add `advanceTimers` option --- docs/user-event/options.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user-event/options.mdx b/docs/user-event/options.mdx index 3ecb0044d..f6345ad3a 100644 --- a/docs/user-event/options.mdx +++ b/docs/user-event/options.mdx @@ -6,6 +6,13 @@ title: Options The following options allow to adjust the behavior of `user-event` APIs. They can be applied per [`setup()`](setup.mdx). +### advanceTimers + +A function to advance your fake timers (if applicable), when we +[`delay`](#delay) subsequent calls. + +`default`: `() => Promise.resolve()` + ### applyAccept When using [`upload()`](api-utility.mdx#upload), automatically discard files From 03ced1f6310929ce366294e67d5cbe1108bbd6f5 Mon Sep 17 00:00:00 2001 From: Philipp Fritsche Date: Mon, 11 Apr 2022 07:37:57 +0000 Subject: [PATCH 2/2] rephrase --- docs/user-event/options.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/user-event/options.mdx b/docs/user-event/options.mdx index f6345ad3a..5f03b9897 100644 --- a/docs/user-event/options.mdx +++ b/docs/user-event/options.mdx @@ -8,8 +8,12 @@ can be applied per [`setup()`](setup.mdx). ### advanceTimers -A function to advance your fake timers (if applicable), when we -[`delay`](#delay) subsequent calls. +If you are using fake timers, you need to advance your timers when we internally +[delay](#delay) subsequent code. + +```ts +(delay: number) => Promise | void +``` `default`: `() => Promise.resolve()`