diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-12-09 13:52:48 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-12-09 13:52:48 +0100 |
| commit | ae3cae40c16b01683b2a562ac48799699c711ca2 (patch) | |
| tree | 88b3aae528c977fe0a86f4a2f8974668dced84d8 /gui/test | |
| parent | 83bdea1ba486c2625e99625e1948730359d01d22 (diff) | |
| parent | d53403ee74a89643c3f3ff201128b32fc760798f (diff) | |
| download | mullvadvpn-ae3cae40c16b01683b2a562ac48799699c711ca2.tar.xz mullvadvpn-ae3cae40c16b01683b2a562ac48799699c711ca2.zip | |
Merge branch 'improve-ipc'
Diffstat (limited to 'gui/test')
| -rw-r--r-- | gui/test/account-data-cache.spec.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gui/test/account-data-cache.spec.ts b/gui/test/account-data-cache.spec.ts index 770b3ca1f4..c482e16a5d 100644 --- a/gui/test/account-data-cache.spec.ts +++ b/gui/test/account-data-cache.spec.ts @@ -25,7 +25,7 @@ describe('IAccountData cache', () => { (_data) => {}, ); - const watcher = new Promise((resolve, reject) => { + const watcher = new Promise<void>((resolve, reject) => { cache.fetch(dummyAccountToken, { onFinish: () => resolve(), onError: (_error: Error) => reject(), @@ -41,7 +41,7 @@ describe('IAccountData cache', () => { (_data) => {}, ); - const watcher = new Promise((resolve, reject) => { + const watcher = new Promise<void>((resolve, reject) => { cache.fetch(dummyAccountToken, { onFinish: (_reason?: any) => resolve(), onError: (_error: Error) => reject(), @@ -52,7 +52,7 @@ describe('IAccountData cache', () => { }); it('should update when fetch succeeds on the first attempt', async () => { - const update = new Promise((resolve, reject) => { + const update = new Promise<void>((resolve, reject) => { const cache = new AccountDataCache( (_) => Promise.resolve(dummyAccountData), () => resolve(), @@ -68,7 +68,7 @@ describe('IAccountData cache', () => { }); it('should update when fetch succeeds on the second attempt', async () => { - const update = new Promise((resolve, reject) => { + const update = new Promise<void>((resolve, reject) => { let firstAttempt = true; const fetch = () => { if (firstAttempt) { @@ -96,7 +96,7 @@ describe('IAccountData cache', () => { const firstError = spy((_error: Error) => {}); const secondSuccess = spy(); - const update = new Promise<IAccountData>((resolve, reject) => { + const update = new Promise<IAccountData | void>((resolve, reject) => { let firstAttempt = true; const fetch = (_token: string) => { if (firstAttempt) { @@ -139,7 +139,7 @@ describe('IAccountData cache', () => { const expiredSpy = spy(); const nonExpiredSpy = spy(); - const update = new Promise((resolve, reject) => { + const update = new Promise<void>((resolve, reject) => { let firstAttempt = true; const fetch = () => { if (firstAttempt) { @@ -216,7 +216,7 @@ describe('IAccountData cache', () => { it('should not perform a fetch if called twice synchronously', async () => { const fetchSpy = spy(); - const update = new Promise((resolve, _reject) => { + const update = new Promise<void>((resolve, _reject) => { const fetch = () => { fetchSpy(); return Promise.resolve(dummyAccountData); @@ -238,7 +238,7 @@ describe('IAccountData cache', () => { date.setMinutes(date.getMinutes() + 3); const expiry = date.toISOString(); - const update = new Promise((resolve, reject) => { + const update = new Promise<void>((resolve, reject) => { let firstAttempt = true; const fetch = () => { if (firstAttempt) { |
