From 309ddf6ec703dc0df925600c29dc2c03abeeff9f Mon Sep 17 00:00:00 2001 From: forgejo-backport-action Date: Wed, 25 Jun 2025 16:43:06 +0200 Subject: [PATCH] [v12.0/forgejo] chore(ci): testSleep: show actual times on failures (#8277) **Backport:** https://codeberg.org/forgejo/forgejo/pulls/8271 I just experienced a spurious error on `testSleep`. The current assertion only showed `expected false to be truthy`. With this PR it should show the actual elapsed time (to be able to knowingly adjust the expected delay). Co-authored-by: oliverpool Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8277 Reviewed-by: Beowulf Co-authored-by: forgejo-backport-action Co-committed-by: forgejo-backport-action --- web_src/js/utils.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/utils.test.js b/web_src/js/utils.test.js index 535aae874a..365eb63e30 100644 --- a/web_src/js/utils.test.js +++ b/web_src/js/utils.test.js @@ -1,3 +1,4 @@ +import {expect, test} from 'vitest'; import { basename, extname, isObject, stripTags, parseIssueHref, parseUrl, translateMonth, translateDay, blobToDataURI, @@ -182,5 +183,5 @@ async function testSleep(ms) { await sleep(ms); const endTime = Date.now(); // Record the end time const actualSleepTime = endTime - startTime; - expect(actualSleepTime >= ms).toBeTruthy(); + expect(actualSleepTime).toBeGreaterThanOrEqual(ms); }