mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-07-02 18:00:03 +02:00
chore(ci): testSleep: show actual times on failures (#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). Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8271 Reviewed-by: floss4good <floss4good@noreply.codeberg.org> Reviewed-by: Beowulf <beowulf@beocode.eu> Co-authored-by: oliverpool <git@olivier.pfad.fr> Co-committed-by: oliverpool <git@olivier.pfad.fr>
This commit is contained in:
parent
8844b6b8e5
commit
2bca029f6f
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue