From 88a37e4735cffabeba51c8cff365d74d6b84e310 Mon Sep 17 00:00:00 2001 From: CRT Date: Tue, 13 Oct 2026 20:47:22 +0800 Subject: [PATCH] tests: unique package names for the public page cache test (the temp-folder cache outlives a run) --- tests/play-public-version-match.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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);