From 97f44ace665caf30ef61b2d5eb00387aba6d1a33 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Wed, 24 Jul 2024 02:46:02 -0400 Subject: [PATCH] Loosen timings to avoid false failures. (#10215) Biggest ones here are the not resolved tests that can be evaluated at any time. --- libs/common/spec/matchers/promise-fulfilled.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/common/spec/matchers/promise-fulfilled.spec.ts b/libs/common/spec/matchers/promise-fulfilled.spec.ts index 80c7b0122f..cbb3147174 100644 --- a/libs/common/spec/matchers/promise-fulfilled.spec.ts +++ b/libs/common/spec/matchers/promise-fulfilled.spec.ts @@ -18,11 +18,11 @@ describe("toBeFulfilled", () => { it("passes when the promise is fulfilled within the given time limit", async () => { const promise = new Promise((resolve) => setTimeout(resolve, 1)); - await expect(promise).toBeFulfilled(2); + await expect(promise).toBeFulfilled(25); }); it("passes when the promise is not fulfilled within the given time limit", async () => { - const promise = new Promise((resolve) => setTimeout(resolve, 2)); + const promise = new Promise(() => {}); await expect(promise).not.toBeFulfilled(1); }); }); @@ -47,11 +47,11 @@ describe("toBeResolved", () => { it("passes when the promise is resolved within the given time limit", async () => { const promise = new Promise((resolve) => setTimeout(resolve, 1)); - await expect(promise).toBeResolved(2); + await expect(promise).toBeResolved(50); }); it("passes when the promise is not resolved within the given time limit", async () => { - const promise = new Promise((resolve) => setTimeout(resolve, 2)); + const promise = new Promise(() => {}); await expect(promise).not.toBeResolved(1); }); }); @@ -76,11 +76,11 @@ describe("toBeRejected", () => { it("passes when the promise is resolved within the given time limit", async () => { const promise = new Promise((_, reject) => setTimeout(reject, 1)); - await expect(promise).toBeFulfilled(2); + await expect(promise).toBeFulfilled(50); }); it("passes when the promise is not resolved within the given time limit", async () => { - const promise = new Promise((_, reject) => setTimeout(reject, 2)); + const promise = new Promise(() => {}); await expect(promise).not.toBeFulfilled(1); }); });