diff options
author | 2023-07-24 19:14:41 -0700 | |
---|---|---|
committer | 2023-07-24 19:14:41 -0700 | |
commit | 4ebf858f43a88d715eab7201f7c3c92588d4a75d (patch) | |
tree | ce5e969f5c142276187f5cb25f3e85b2ccdb8ce9 | |
parent | 90ce74a43e517ab0cb84550db2c340b2c0754ded (diff) | |
download | bun-4ebf858f43a88d715eab7201f7c3c92588d4a75d.tar.gz bun-4ebf858f43a88d715eab7201f7c3c92588d4a75d.tar.zst bun-4ebf858f43a88d715eab7201f7c3c92588d4a75d.zip |
Less flaky
-rw-r--r-- | test/js/bun/util/sleepSync.test.ts | 8 |
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 () => { |