diff --git a/lib/desktop/__tests__/os-commands.test.ts b/lib/desktop/__tests__/os-commands.test.ts index cd724ed85..d904c486c 100644 --- a/lib/desktop/__tests__/os-commands.test.ts +++ b/lib/desktop/__tests__/os-commands.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import type { BulwarkDesktopBridge, DesktopOsCommand } from '../types'; import type { NotificationActionRequest, NotificationActionStatus } from '@/lib/pwa-notify/page-actions'; @@ -44,6 +44,12 @@ async function run(command: DesktopOsCommand) { const text = (value: string) => new TextEncoder().encode(value); +// The handler pulls in much of the app the first time; load it once here, with room to spare, +// so the first test isn't the one that times out on a busy machine. +beforeAll(async () => { + await import('../os-commands'); +}, 60_000); + beforeEach(async () => { vi.clearAllMocks(); authenticated = true;