Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Add push unregister test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpassos committed Jun 21, 2019
1 parent 3af57ba commit b2d6d91
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/push/test/PushRegistrationTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,27 @@ describe("Registration tests", () => {
}
});
});

describe("#unregister", async () => {
it("should fail to unregister in push server", async () => {
try {
await registration.unregister();
assert.fail();
} catch (_) {
return "ok";
}
});

it("should unregister 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 {
global.window.localStorage = { getItem: () => "deviceToken" };
await registration.unregister();
} catch (error) {
assert.fail(error);
}
});
});
});

0 comments on commit b2d6d91

Please sign in to comment.