fix flaky setTimeout test (#10656)

This commit is contained in:
Dylan Conway
2024-04-29 12:47:08 -07:00
committed by GitHub
parent 7af0ed164a
commit fbbc20fe83

View File

@@ -154,7 +154,7 @@ it("Bun.sleep works with a Date object", async () => {
var ten_ms = new Date();
ten_ms.setMilliseconds(ten_ms.getMilliseconds() + offset);
await Bun.sleep(ten_ms);
expect(Math.ceil(performance.now() - now)).toBeGreaterThan(offset);
expect(Math.ceil(performance.now() - now)).toBeGreaterThanOrEqual(offset);
});
it("Bun.sleep(Date) fulfills after Date", async () => {