From 68d37b1fe1199507f6a7007eaa9cce5a30b2f709 Mon Sep 17 00:00:00 2001 From: Jan Hellar Date: Mon, 3 Jun 2019 10:52:59 +0200 Subject: [PATCH] increased timeout for push-registration test --- packages/push/test/PushRegistrationTest.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/push/test/PushRegistrationTest.ts b/packages/push/test/PushRegistrationTest.ts index e3859d1c..c6331cc3 100644 --- a/packages/push/test/PushRegistrationTest.ts +++ b/packages/push/test/PushRegistrationTest.ts @@ -33,17 +33,23 @@ describe("Registration tests", () => { describe("#register", async () => { it("should fail to register in push server", async () => { - registration.register(undefined as unknown as string, "cordova", ["Test"]).then(() => { + try { + await registration.register(undefined as unknown as string, "cordova", ["Test"]); assert.fail(); - }).catch(() => { + } catch (_) { return "ok"; - }); + } }); - it("should register in push server", async () => { - return registration.register("token", "cordova", ["Test"]).catch((error) => { + it("should register in push server", async function() { + // in CI environment this test sometimes fails because of the default timeout 2s + // increase timeout to 10s + this.timeout(10000); + try { + await registration.register("token", "cordova", ["Test"]); + } catch (error) { assert.fail(error); - }); + } }); }); });