diff --git a/tests/play-public-version-match.test.ts b/tests/play-public-version-match.test.ts index 2942134..7321826 100644 --- a/tests/play-public-version-match.test.ts +++ b/tests/play-public-version-match.test.ts @@ -94,14 +94,15 @@ describe('public store page read', () => { expect(await playPublicPage('com.example.first200', { noCache: true })).toMatchObject({ state: 'public', http: 200, versionName: '1.0.0' }); }); test('offline or a server error = unknown; unknown is never cached', async () => { + const off = `com.example.offline${Date.now()}`; globalThis.fetch = (async () => { throw new Error('getaddrinfo ENOTFOUND play.google.com'); }) as unknown as typeof fetch; - const r = await playPublicPage('com.example.offline', { noCache: true }); + const r = await playPublicPage(off, { noCache: true }); expect(r).toMatchObject({ state: 'unknown', http: null }); expect(r.error).toContain('ENOTFOUND'); answer(503); - expect((await playPublicPage('com.example.offline')).state).toBe('unknown'); + expect((await playPublicPage(off)).state).toBe('unknown'); answer(404); - expect((await playPublicPage('com.example.offline')).state).toBe('notPublic'); + expect((await playPublicPage(off)).state).toBe('notPublic'); }); test('answers are cached for a few minutes', async () => { const urls = answer(404);