aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-24 19:14:41 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-24 19:14:41 -0700
commit4ebf858f43a88d715eab7201f7c3c92588d4a75d (patch)
treece5e969f5c142276187f5cb25f3e85b2ccdb8ce9
parent90ce74a43e517ab0cb84550db2c340b2c0754ded (diff)
downloadbun-4ebf858f43a88d715eab7201f7c3c92588d4a75d.tar.gz
bun-4ebf858f43a88d715eab7201f7c3c92588d4a75d.tar.zst
bun-4ebf858f43a88d715eab7201f7c3c92588d4a75d.zip
Less flaky
-rw-r--r--test/js/bun/util/sleepSync.test.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/js/bun/util/sleepSync.test.ts b/test/js/bun/util/sleepSync.test.ts
index e4204e1d3..21052d314 100644
--- a/test/js/bun/util/sleepSync.test.ts
+++ b/test/js/bun/util/sleepSync.test.ts
@@ -2,11 +2,11 @@ import { it, expect } from "bun:test";
import { sleepSync } from "bun";
it("sleepSync uses milliseconds", async () => {
- const start = Date.now();
- sleepSync(5);
- const end = Date.now();
+ const start = performance.now();
+ sleepSync(50);
+ const end = performance.now();
expect(end - start).toBeGreaterThanOrEqual(5);
- expect(end - start).toBeLessThan(10);
+ expect(end - start).toBeLessThan(1000);
});
it("sleepSync with no arguments throws", async () => {